Skip to content

Commit 1fdc6e7

Browse files
committed
warm up extension before integration tests to avoid 404 race on first connect
1 parent b5bb535 commit 1fdc6e7

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,21 @@ jobs:
238238
sleep 1
239239
done
240240
241+
- name: Warm up — wait for websocket extension to finish registering endpoints
242+
run: |
243+
# The extension's Registrar runs on a background thread after Lucee starts —
244+
# if we fire integration tests before it's registered /ws/* endpoints, we get
245+
# 404 during the WebSocket upgrade. Poll test-websocket-info.cfm which returns
246+
# SUCCESS once the extension is loaded and endpoints are registered.
247+
for i in {1..30}; do
248+
RESPONSE=$(curl -s http://localhost:8888/tests/test-websocket-info.cfm)
249+
if echo "$RESPONSE" | grep -q "SUCCESS"; then
250+
echo "Extension ready after $i attempts"
251+
break
252+
fi
253+
sleep 1
254+
done
255+
241256
- name: Run integration tests
242257
id: integration-tests
243258
continue-on-error: true

0 commit comments

Comments
 (0)