Skip to content

Commit 3362a88

Browse files
committed
Fix starting/stopping servers
1 parent fef31e6 commit 3362a88

File tree

1 file changed

+36
-6
lines changed

1 file changed

+36
-6
lines changed

.github/workflows/benchmark.yml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,17 @@ jobs:
267267
for i in {1..30}; do
268268
if curl -fsS http://localhost:3001 > /dev/null; then
269269
echo "✅ Server is ready and responding"
270-
exit 0
270+
break
271271
fi
272272
echo " Attempt $i/30: Server not ready yet..."
273273
sleep 1
274274
done
275275
276-
echo "❌ ERROR: Server failed to start within 30 seconds"
277-
exit 1
276+
# Check if server is actually responding
277+
if ! curl -fsS http://localhost:3001 > /dev/null; then
278+
echo "❌ ERROR: Server failed to start within 30 seconds"
279+
exit 1
280+
fi
278281
279282
# ============================================
280283
# STEP 5: RUN CORE BENCHMARKS
@@ -294,6 +297,18 @@ jobs:
294297
295298
echo "✅ Benchmark suite completed successfully"
296299
300+
- name: Stop Core production server
301+
if: env.APP_VERSION != 'pro_only' && always()
302+
run: |
303+
echo "🛑 Stopping Core production server..."
304+
# Find and kill the Puma process on port 3001
305+
if lsof -ti:3001 > /dev/null 2>&1; then
306+
kill $(lsof -ti:3001) || true
307+
echo "✅ Server stopped"
308+
else
309+
echo "ℹ️ No server running on port 3001"
310+
fi
311+
297312
- name: Validate Core benchmark results
298313
if: env.APP_VERSION != 'pro_only'
299314
run: |
@@ -418,14 +433,17 @@ jobs:
418433
for i in {1..30}; do
419434
if curl -fsS http://localhost:3001 > /dev/null; then
420435
echo "✅ Server is ready and responding"
421-
exit 0
436+
break
422437
fi
423438
echo " Attempt $i/30: Server not ready yet..."
424439
sleep 1
425440
done
426441
427-
echo "❌ ERROR: Server failed to start within 30 seconds"
428-
exit 1
442+
# Check if server is actually responding
443+
if ! curl -fsS http://localhost:3001 > /dev/null; then
444+
echo "❌ ERROR: Server failed to start within 30 seconds"
445+
exit 1
446+
fi
429447
430448
# ============================================
431449
# STEP 7: RUN PRO BENCHMARKS
@@ -445,6 +463,18 @@ jobs:
445463
446464
echo "✅ Benchmark suite completed successfully"
447465
466+
- name: Stop Pro production server
467+
if: env.APP_VERSION != 'core_only' && always()
468+
run: |
469+
echo "🛑 Stopping Pro production server..."
470+
# Find and kill the Puma process on port 3001
471+
if lsof -ti:3001 > /dev/null 2>&1; then
472+
kill $(lsof -ti:3001) || true
473+
echo "✅ Server stopped"
474+
else
475+
echo "ℹ️ No server running on port 3001"
476+
fi
477+
448478
- name: Validate Pro benchmark results
449479
if: env.APP_VERSION != 'core_only'
450480
run: |

0 commit comments

Comments
 (0)