Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions test/integration/apimanager_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,6 @@ var _ = Describe("APIManager controller", func() {
// Verify no perpetual reconciliation occurred during initial deployment.
verifyNoDeploymentUpdates(0)

// Trigger a synthetic change and confirm the operator corrects it exactly once.
triggerSyntheticDeploymentUpdate(testNamespace, GinkgoWriter)
time.Sleep(settlingPeriod)
verifyNoDeploymentUpdates(1)

elapsed := time.Since(start)
fmt.Fprintf(GinkgoWriter, "APIManager creation and availability took '%s'\n", elapsed)
})
Expand Down Expand Up @@ -1061,36 +1056,6 @@ func testCustomEnvironmentContent() string {
`
}

// triggerSyntheticDeploymentUpdate patches a monitored deployment with a dummy
// image tag, then waits for the operator to reconcile it back. This guarantees
// at least one Deployment UPDATE in the ReconcileCounter, proving the counter
// is wired correctly and not silently counting nothing.
func triggerSyntheticDeploymentUpdate(namespace string, w io.Writer) {
const deploymentName = "system-memcache"

dep := &appsv1.Deployment{}
Expect(testK8sClient.Get(context.Background(),
types.NamespacedName{Name: deploymentName, Namespace: namespace}, dep)).To(Succeed())

originalImage := dep.Spec.Template.Spec.Containers[0].Image
dep.Spec.Template.Spec.Containers[0].Image = originalImage + "-synthetic-test-trigger"
Expect(testK8sClient.Update(context.Background(), dep)).To(Succeed())
fmt.Fprintf(w, "Synthetic image change applied to %s; waiting for operator to reconcile back\n", deploymentName)

// Use testK8sAPIClient (direct API server read) to avoid the cached client
// returning the pre-update image before the operator has processed the change.
Eventually(func() bool {
d := &appsv1.Deployment{}
if err := testK8sAPIClient.Get(context.Background(),
types.NamespacedName{Name: deploymentName, Namespace: namespace}, d); err != nil {
return false
}
return d.Spec.Template.Spec.Containers[0].Image == originalImage
}, 2*time.Minute, 2*time.Second).Should(BeTrue(),
fmt.Sprintf("operator did not revert synthetic image change on %s within 2 minutes", deploymentName))
fmt.Fprintf(w, "Operator reconciled %s back to desired image\n", deploymentName)
}

func testGetCustomEnvironmentSecret(namespace string) *corev1.Secret {
customEnvironmentSecret := corev1.Secret{
TypeMeta: metav1.TypeMeta{
Expand Down
5 changes: 0 additions & 5 deletions test/integration/verify_no_perpetual_reconciliation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@ package integration
import (
"fmt"
"sort"
"time"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

// settlingPeriod is the time to wait after the synthetic update is reconciled
// to confirm no further updates occur.
const settlingPeriod = 30 * time.Second

// verifyNoDeploymentUpdates asserts that the reconcile counter recorded exactly
// the expected number of deployment updates, then resets the counter so the
// next measurement window starts from zero.
Expand Down
Loading