Skip to content

Commit 41b68fc

Browse files
committed
Fix WebSocket server startup by using sequential start with port confirmation
- Start 6 server combinations sequentially instead of simultaneously - Wait for each server port to be listening before starting the next one - 30-second timeout per server with detailed error logging - Clear progress reporting for each server startup - Prevents race conditions and dependency installation conflicts - More reliable server startup in CI environment
1 parent fe1ae4e commit 41b68fc

1 file changed

Lines changed: 90 additions & 17 deletions

File tree

.github/workflows/wstest.yml

Lines changed: 90 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -136,32 +136,105 @@ jobs:
136136
137137
- name: Start all WebSocket servers
138138
run: |
139-
echo "==> Starting 6 WebSocket server combinations..."
139+
echo "==> Starting 6 WebSocket server combinations sequentially..."
140+
141+
# Server 1: Twisted + CPython 3.11 on port 9011
142+
echo "==> Starting Twisted + cpy311 server on port 9011..."
140143
nohup just wstest-testeeserver-twisted cpy311 "ws://127.0.0.1:9011" > twisted-cpy311.log 2>&1 &
144+
for i in {1..30}; do
145+
if netstat -tuln | grep :9011 >/dev/null 2>&1; then
146+
echo "✅ Twisted + cpy311 server running on port 9011"
147+
break
148+
fi
149+
if [ $i -eq 30 ]; then
150+
echo "❌ Twisted + cpy311 server failed to start on port 9011"
151+
cat twisted-cpy311.log
152+
exit 1
153+
fi
154+
sleep 1
155+
done
156+
157+
# Server 2: asyncio + CPython 3.11 on port 9012
158+
echo "==> Starting asyncio + cpy311 server on port 9012..."
141159
nohup just wstest-testeeserver-asyncio cpy311 "ws://127.0.0.1:9012" > asyncio-cpy311.log 2>&1 &
160+
for i in {1..30}; do
161+
if netstat -tuln | grep :9012 >/dev/null 2>&1; then
162+
echo "✅ asyncio + cpy311 server running on port 9012"
163+
break
164+
fi
165+
if [ $i -eq 30 ]; then
166+
echo "❌ asyncio + cpy311 server failed to start on port 9012"
167+
cat asyncio-cpy311.log
168+
exit 1
169+
fi
170+
sleep 1
171+
done
172+
173+
# Server 3: Twisted + CPython 3.14 on port 9013
174+
echo "==> Starting Twisted + cpy314 server on port 9013..."
142175
nohup just wstest-testeeserver-twisted cpy314 "ws://127.0.0.1:9013" > twisted-cpy314.log 2>&1 &
176+
for i in {1..30}; do
177+
if netstat -tuln | grep :9013 >/dev/null 2>&1; then
178+
echo "✅ Twisted + cpy314 server running on port 9013"
179+
break
180+
fi
181+
if [ $i -eq 30 ]; then
182+
echo "❌ Twisted + cpy314 server failed to start on port 9013"
183+
cat twisted-cpy314.log
184+
exit 1
185+
fi
186+
sleep 1
187+
done
188+
189+
# Server 4: asyncio + CPython 3.14 on port 9014
190+
echo "==> Starting asyncio + cpy314 server on port 9014..."
143191
nohup just wstest-testeeserver-asyncio cpy314 "ws://127.0.0.1:9014" > asyncio-cpy314.log 2>&1 &
192+
for i in {1..30}; do
193+
if netstat -tuln | grep :9014 >/dev/null 2>&1; then
194+
echo "✅ asyncio + cpy314 server running on port 9014"
195+
break
196+
fi
197+
if [ $i -eq 30 ]; then
198+
echo "❌ asyncio + cpy314 server failed to start on port 9014"
199+
cat asyncio-cpy314.log
200+
exit 1
201+
fi
202+
sleep 1
203+
done
204+
205+
# Server 5: Twisted + PyPy 3.11 on port 9015
206+
echo "==> Starting Twisted + pypy311 server on port 9015..."
144207
nohup just wstest-testeeserver-twisted pypy311 "ws://127.0.0.1:9015" > twisted-pypy311.log 2>&1 &
208+
for i in {1..30}; do
209+
if netstat -tuln | grep :9015 >/dev/null 2>&1; then
210+
echo "✅ Twisted + pypy311 server running on port 9015"
211+
break
212+
fi
213+
if [ $i -eq 30 ]; then
214+
echo "❌ Twisted + pypy311 server failed to start on port 9015"
215+
cat twisted-pypy311.log
216+
exit 1
217+
fi
218+
sleep 1
219+
done
220+
221+
# Server 6: asyncio + PyPy 3.11 on port 9016
222+
echo "==> Starting asyncio + pypy311 server on port 9016..."
145223
nohup just wstest-testeeserver-asyncio pypy311 "ws://127.0.0.1:9016" > asyncio-pypy311.log 2>&1 &
146-
147-
sleep 10
148-
149-
echo "==> Verifying all servers are running..."
150-
for port in 9011 9012 9013 9014 9015 9016; do
151-
if ! netstat -tuln | grep :${port}; then
152-
echo "❌ Server failed to start on port ${port}"
153-
case $port in
154-
9011) cat twisted-cpy311.log ;;
155-
9012) cat asyncio-cpy311.log ;;
156-
9013) cat twisted-cpy314.log ;;
157-
9014) cat asyncio-cpy314.log ;;
158-
9015) cat twisted-pypy311.log ;;
159-
9016) cat asyncio-pypy311.log ;;
160-
esac
224+
for i in {1..30}; do
225+
if netstat -tuln | grep :9016 >/dev/null 2>&1; then
226+
echo "✅ asyncio + pypy311 server running on port 9016"
227+
break
228+
fi
229+
if [ $i -eq 30 ]; then
230+
echo "❌ asyncio + pypy311 server failed to start on port 9016"
231+
cat asyncio-pypy311.log
161232
exit 1
162233
fi
234+
sleep 1
163235
done
164-
echo "✅ All 6 servers are running"
236+
237+
echo "✅ All 6 WebSocket servers are running successfully"
165238
166239
- name: Run server tests
167240
run: just wstest-fuzzingclient "" "" ${{ env.TEST_MODE }}

0 commit comments

Comments
 (0)