Skip to content

Commit 4225c33

Browse files
committed
ci: wait for server to be ready instead of sleeping
1 parent dce311c commit 4225c33

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/maintests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
run: |
7575
python -m pip install -r requirements.txt -r requirements.dev.txt
7676
python server.py -vvvvi --horde stable &
77-
sleep 5
77+
for i in $(seq 1 30); do curl -sf http://localhost:7001/ > /dev/null && break; echo "Waiting for server… ($i)"; sleep 2; done
7878
7979
curl -X POST --data-raw 'username=test_user' http://localhost:7001/register | grep -Po '<code class="ah-api-key">\K[^<]*(?=</code>)' > tests/apikey.txt
8080
export AI_HORDE_DEV_APIKEY=$(cat tests/apikey.txt)

.github/workflows/prtests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
run: |
9898
python -m pip install -r requirements.txt -r requirements.dev.txt
9999
python server.py -vvvvi --horde stable &
100-
sleep 5
100+
for i in $(seq 1 30); do curl -sf http://localhost:7001/ > /dev/null && break; echo "Waiting for server… ($i)"; sleep 2; done
101101
102102
curl -X POST --data-raw 'username=test_user' http://localhost:7001/register | grep -Po '<code class="ah-api-key">\K[^<]*(?=</code>)' > tests/apikey.txt
103103
export AI_HORDE_DEV_APIKEY=$(cat tests/apikey.txt)

0 commit comments

Comments
 (0)