@@ -533,55 +533,72 @@ jobs:
533533 run : |
534534 set -euo pipefail
535535
536- # Two servers, because row virtualization is read from import.meta.env
537- # at module load: one process cannot serve both builds.
538- bun run --cwd packages/studio dev -- --port 5313 --strictPort &
539- DEFAULT_PID=$!
540- VITE_STUDIO_TIMELINE_ROW_VIRTUALIZATION_ENABLED=1 \
541- bun run --cwd packages/studio dev -- --port 5314 --strictPort &
542- VIRTUALIZED_PID=$!
543- trap 'kill $DEFAULT_PID $VIRTUALIZED_PID 2>/dev/null || true' EXIT
544-
545- for i in $(seq 1 60); do
546- if curl -sf http://localhost:5313/ >/dev/null 2>&1 \
547- && curl -sf http://localhost:5314/ >/dev/null 2>&1; then break; fi
548- sleep 1
549- done
550- if ! curl -sf http://localhost:5313/ >/dev/null 2>&1 \
551- || ! curl -sf http://localhost:5314/ >/dev/null 2>&1; then
552- echo "FAIL: studio dev servers did not start"
553- exit 1
536+ SERVER_PID=""
537+ stop_server() {
538+ if [[ -n "$SERVER_PID" ]]; then
539+ kill "$SERVER_PID" 2>/dev/null || true
540+ wait "$SERVER_PID" 2>/dev/null || true
541+ SERVER_PID=""
542+ fi
543+ }
544+ wait_for_server() {
545+ local port="$1"
546+ for i in $(seq 1 60); do
547+ if curl -sf "http://localhost:${port}/" >/dev/null 2>&1; then return 0; fi
548+ sleep 1
549+ done
550+ echo "FAIL: studio dev server did not start on port ${port}"
551+ return 1
552+ }
553+ trap stop_server EXIT
554+
555+ # Run one server at a time so the measured browser never competes with
556+ # a second Vite module graph on the shared runner. The development
557+ # server supplies the fixture API; production React matches shipped
558+ # rendering behavior, and the gate asserts that runtime before timing.
559+ NODE_ENV=production \
560+ bun run --cwd packages/studio dev -- --port 5313 --strictPort &
561+ SERVER_PID=$!
562+ DEFAULT_STATUS=0
563+ if wait_for_server 5313; then
564+ STUDIO_URL="http://localhost:5313/#project/timeline-virtualization" \
565+ TIMELINE_ROW_VIRTUALIZATION=on \
566+ TIMELINE_ELEMENT_COUNT=50000 \
567+ TIMELINE_TIER=ci \
568+ node packages/studio/tests/e2e/timeline-virtualization.mjs \
569+ | tee /tmp/timeline-gate-default.json \
570+ || DEFAULT_STATUS=$?
571+ else
572+ DEFAULT_STATUS=1
554573 fi
574+ stop_server
555575
556- # The default build first. It is the one users get, and the arm that
557- # caught the regression this gate exists for.
558- # Capture both statuses so either failure still leaves two evidence files.
559- DEFAULT_STATUS=0
560- STUDIO_URL="http://localhost:5313/#project/timeline-virtualization" \
561- TIMELINE_ROW_VIRTUALIZATION=off \
562- TIMELINE_ELEMENT_COUNT=1000 \
563- TIMELINE_TIER=ci \
564- node packages/studio/tests/e2e/timeline-virtualization.mjs \
565- | tee /tmp/timeline-gate-default.json \
566- || DEFAULT_STATUS=$?
567-
568- VIRTUALIZED_STATUS=0
569- STUDIO_URL="http://localhost:5314/#project/timeline-virtualization" \
570- TIMELINE_ROW_VIRTUALIZATION=on \
571- TIMELINE_ELEMENT_COUNT=50000 \
572- TIMELINE_TIER=ci \
573- node packages/studio/tests/e2e/timeline-virtualization.mjs \
574- | tee /tmp/timeline-gate-virtualized.json \
575- || VIRTUALIZED_STATUS=$?
576+ NODE_ENV=production \
577+ VITE_STUDIO_TIMELINE_ROW_VIRTUALIZATION_ENABLED=0 \
578+ bun run --cwd packages/studio dev -- --port 5314 --strictPort &
579+ SERVER_PID=$!
580+ DISABLED_STATUS=0
581+ if wait_for_server 5314; then
582+ STUDIO_URL="http://localhost:5314/#project/timeline-virtualization" \
583+ TIMELINE_ROW_VIRTUALIZATION=off \
584+ TIMELINE_ELEMENT_COUNT=1000 \
585+ TIMELINE_TIER=ci \
586+ node packages/studio/tests/e2e/timeline-virtualization.mjs \
587+ | tee /tmp/timeline-gate-disabled.json \
588+ || DISABLED_STATUS=$?
589+ else
590+ DISABLED_STATUS=1
591+ fi
592+ stop_server
576593
577594 {
578595 echo "### Timeline viewport gate"
579596 echo "- Default arm exit: ${DEFAULT_STATUS}"
580- echo "- Virtualized arm exit: ${VIRTUALIZED_STATUS }"
597+ echo "- Explicitly disabled arm exit: ${DISABLED_STATUS }"
581598 } >> "$GITHUB_STEP_SUMMARY"
582599
583- if (( DEFAULT_STATUS != 0 || VIRTUALIZED_STATUS != 0 )); then
584- echo "FAIL: default=${DEFAULT_STATUS}, virtualized =${VIRTUALIZED_STATUS }"
600+ if (( DEFAULT_STATUS != 0 || DISABLED_STATUS != 0 )); then
601+ echo "FAIL: default=${DEFAULT_STATUS}, disabled =${DISABLED_STATUS }"
585602 exit 1
586603 fi
587604 - name : Upload gate evidence
0 commit comments