Skip to content

Commit cb81b8a

Browse files
check until ready
1 parent 18940f9 commit cb81b8a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/emulator-test.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ jobs:
2222
run: |
2323
gcloud beta emulators datastore start --host-port=localhost:8010 --project=dummy-project &
2424
sleep 10
25+
- name: Wait for Datastore Emulator to be ready
26+
run: |
27+
for i in {1..30}; do
28+
if nc -z localhost 8010; then
29+
echo "Datastore emulator is up!"
30+
break
31+
fi
32+
echo "Waiting for emulator... ($i)"
33+
sleep 1
34+
done
35+
if ! nc -z localhost 8010; then
36+
echo "Emulator did not start in time!" >&2
37+
exit 1
38+
fi
2539
- name: Set environment variables
2640
run: |
2741
echo "DATASTORE_EMULATOR_HOST=localhost:8010" >> $GITHUB_ENV

0 commit comments

Comments
 (0)