{{ message }}
Repository navigation
End a dashboard run whose process exits before reporting - #443
Merged
Merged
Conversation
A run started from the dashboard leaves its "Running" state only when the worker streams its final suites or when the backend sends testStopped. A child that exits before a worker connects, such as a config preflight refusing to start or a missing driver, sends neither. The row then showed only a Stop button, so the test could not be rerun. The backend now sends testStopped with a reason when a spawned run closes before any worker connected. The app marks the tests the run never reached as failed, with that reason as their error. The same close handler also cleared the rerun-child flag only on stop(), so the next unrelated worker after an early exit was taken for a rerun child, and it ran for a stopped child after its replacement had started, clearing the new run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
A suite rerun or Run All clears each suite's tests before the child starts, so when that child exits before reporting, the stop reason landed on no test: the suites turned failed and the Errors tab stayed empty. The reason now goes on the topmost suite the stop alone failed, which the Errors tab lists, and is cleared when the suite runs again. A test-level rerun still carries it on the test, so the suite does not repeat it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
A run started from the dashboard leaves its "Running" state only when the worker streams its final suites, or when the backend broadcasts
testStopped. If the spawned process exits before any worker connects, neither arrives. A config preflight that refuses to start, a missing driver, or an unreachable Appium server all do this. The row then shows only a Stop button, so the test cannot be rerun from the dashboard.Found while rerunning a native Appium example whose server had gone down: the backend log showed the child refusing to start, and the dashboard kept spinning.
Change
runner.ts): the child'sclosehandler now:onEarlyExit, with the exit code or signal;stop()already detached, so a late close of a stopped run no longer clears the run that replaced it.index.ts): an early exit broadcaststestStoppedwith areason. The Stop route uses the same helper.TestStoppedWsPayload(stopped,timestamp, optionalreason) wired intoSocketMessage.wire-schema.jsonand the Python generated types are regenerated.markRunningAsStoppedtakes the error message as a parameter. A stopped run still reads "Test execution stopped"; a run that exited early shows its reason, e.g.Run exited before reporting (exit code 1).Tests
backend/tests/runner.test.ts: an early exit is reported with its exit code or signal. A run whose worker connected stays silent. A stopped child closing after its replacement started is ignored, and the replacement's own early exit is still reported.backend/tests/run-early-exit-broadcast.test.ts: end to end. It spawns a real child that exits with code 3 throughPOST /api/tests/run, and asserts thetestStoppedframe a real dashboard client receives.app/tests/data-manager.test.ts: atestStoppedcarrying a reason fails the in-flight test with that message, and the existing stop test now checks the default message.pnpm test: 2734 passed.pnpm lint: 0 errors.Not verified by hand in the dashboard: the stuck state was reproduced before the fix, but the fixed build has only been exercised by the tests above.
🤖 Generated with Claude Code