Skip to content

Commit

Permalink
Waiting before running createdb fixes flaky integration test (#438)
Browse files Browse the repository at this point in the history
* Use pg_isready to determine if postgres is up
* Sleep a bit before attempting to createdb
  • Loading branch information
bogdanap authored Feb 19, 2018
1 parent c3fc692 commit c62379b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion script/http-job-test
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ main() {

docker exec \
--user postgres \
job-board-postgres bash -c 'while ! psql -l; do sleep 1; done'
job-board-postgres bash -c 'while ! pg_isready; do sleep 1; done'

# despite pg_isready reporting the server as up, we still have to wait a bit
# for createdb to be able to successfully connect
sleep 1

docker exec \
--user postgres \
Expand Down

0 comments on commit c62379b

Please sign in to comment.