test(controller): avoid race in test (cherry-pick #25655 for 3.2) (#25691)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
This commit is contained in:
argo-cd-cherry-pick-bot[bot] 2025-12-16 21:06:06 +02:00 committed by GitHub
parent 95e7cdb16f
commit a29703877e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3078,6 +3078,12 @@ func TestDeletionConfirmation(t *testing.T) {
Then().Expect(OperationPhaseIs(OperationRunning)).
When().ConfirmDeletion().
Then().Expect(OperationPhaseIs(OperationSucceeded)).
Expect(SyncStatusIs(SyncStatusCodeSynced)).
Expect(HealthIs(health.HealthStatusHealthy)).
// Wait for controller caches to fully settle before deletion
// This ensures both the informer and cluster watcher have the latest state
When().Refresh(RefreshTypeNormal).
Then().
When().Delete(true).
Then().
And(func(app *Application) {