Skip to content

Commit 79bdd2b

Browse files
committed
ci(integration-test): refactor wait for postgres to use dummy wait and not fail
1 parent 1d9fb87 commit 79bdd2b

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/integration-test.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@ jobs:
1616
- 5432/tcp
1717

1818
steps:
19-
- name: Run tests
19+
- name: Wait for Postgres database to be ready
20+
env:
21+
RETRIES: 5
2022
run: |
21-
echo "Running integration tests..."
22-
telnet 127.0.0.1 ${{ job.services.postgres.ports['5432'] }}
23+
# real retry/wait command
24+
# until psql -h $PG_HOST -U $PG_USER -d $PG_DATABASE -c "select 1" > /dev/null 2>&1 || [ $RETRIES -eq 0 ]; do
25+
# dummy wait
26+
until [ $RETRIES -eq 0 ]; do
27+
echo "Waiting for PostgreSQL to become ready, $((RETRIES--)) attempts remaining..."
28+
sleep 5
29+
done
30+
31+
- name: Run integration tests
32+
run: echo "Running integration tests..."

0 commit comments

Comments
 (0)