From 8ba0e464c81dddc8eab7dc5746d1e464db9cd511 Mon Sep 17 00:00:00 2001 From: Josh Powers Date: Wed, 15 Jun 2022 11:02:56 -0600 Subject: [PATCH] test: update wait for statement for postgres The postgres docker image will start up and immediately shutdown the service will the docker entrypoint starts configuration. This results in the expected ready to accept connections log message to show up twice. This generally happens within a tenth of a second, but in CI this can get hit and the test will fail as the database is not yet up. fixes: #11292 --- plugins/inputs/postgresql/postgresql_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/inputs/postgresql/postgresql_test.go b/plugins/inputs/postgresql/postgresql_test.go index 0ae557a8eb672..2a06de48ad219 100644 --- a/plugins/inputs/postgresql/postgresql_test.go +++ b/plugins/inputs/postgresql/postgresql_test.go @@ -21,7 +21,7 @@ func launchTestContainer(t *testing.T) *testutil.Container { "POSTGRES_HOST_AUTH_METHOD": "trust", }, WaitingFor: wait.ForAll( - wait.ForLog("database system is ready to accept connections"), + wait.ForLog("database system is ready to accept connections").WithOccurrence(2), wait.ForListeningPort(nat.Port(servicePort)), ), }