File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
bindata/assets/deployments Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -196,8 +196,26 @@ spec:
196
196
sock.bind(addr)
197
197
sock.listen(5)
198
198
199
- [Thread(i, socket=sock) for i in range(100)]
199
+ # Start server threads
200
+ threads = [Thread(i, socket=sock) for i in range(100)]
201
+
202
+ # Wait for server to be ready
200
203
ready.wait()
204
+
205
+ # Verify server is actually listening
206
+ for _ in range(30): # Try for 30 seconds
207
+ try:
208
+ test_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
209
+ test_sock.connect(('localhost', 8080))
210
+ test_sock.close()
211
+ break
212
+ except socket.error:
213
+ time.sleep(1)
214
+ else:
215
+ print("Failed to verify server is listening", file=sys.stderr)
216
+ sys.exit(1)
217
+
218
+ print("Server is ready and listening on port 8080")
201
219
time.sleep(9e9)
202
220
EOF
203
221
exec python3 /tmp/serve.py
You can’t perform that action at this time.
0 commit comments