From 7ca17610c1e581640b2153e397680569b20d13bc Mon Sep 17 00:00:00 2001 From: Gavin Frazar Date: Wed, 15 Jan 2025 14:58:46 -0800 Subject: [PATCH] Fix TestWatcherCloudFetchers flakiness --- lib/srv/db/watcher_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/srv/db/watcher_test.go b/lib/srv/db/watcher_test.go index aa6635420589d..7f6e036fd78ad 100644 --- a/lib/srv/db/watcher_test.go +++ b/lib/srv/db/watcher_test.go @@ -325,6 +325,16 @@ func TestWatcherCloudFetchers(t *testing.T) { testCtx.setupDatabaseServer(ctx, t, agentParams{ // Keep ResourceMatchers as nil to disable resource matchers. OnReconcile: func(d types.Databases) { + if len(d) == 0 { + // The dynamic resource matchers and cloud watchers will both + // trigger a reconciliation, but dynamic matchers should return + // 0 resources from first init, whereas the cloud watchers + // should return databases. + // Dynamic matchers are included in config to test that the + // dynamic matcher AWS settings are not applied to cloud watcher + // databases. + return + } reconcileCh <- d }, ResourceMatchers: []services.ResourceMatcher{{