Skip to content

Commit

Permalink
test: update wait for statement for postgres
Browse files Browse the repository at this point in the history
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: influxdata#11292
  • Loading branch information
powersj committed Jun 15, 2022
1 parent 42e339f commit 8ba0e46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/inputs/postgresql/postgresql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
),
}
Expand Down

0 comments on commit 8ba0e46

Please sign in to comment.