Repository navigation
test(desktop): wait for synthetic application children readiness before exercising sigterm release - #10455
test(desktop): wait for synthetic application children readiness before exercising sigterm release#10455LexLuthorPrimero wants to merge 1 commit into
Conversation
…re exercising sigterm release
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Low impact] No new blocking issue was found; the earlier non-blocking readiness finding remains open. Findings
Fix with agent prompt### Issue 1
src/application/desktop/DesktopApplicationCapture.test.ts:147-148
The loop writes `count=1` after 100 attempts even when a child is not ready. The other `installProcessFamily` caller-the session-failure test-still starts cleanup based only on `count=1`. If child startup takes longer than this wait on a busy runner, cleanup can send `SIGTERM` before the child's trap is installed, leaving the same missing-marker flake.
Require both markers before publishing `count=1`, and report a clear startup failure if the wait expires.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryThis test-only change adds readiness markers so the synthetic application's children can install their
Reviews (2) · Last reviewed commit: "test(desktop): wait for synthetic applic..." · Reviewed by Greptile |
| `for i in $(seq 1 100); do [ -f "${join(root, "group-ready")}" ] && [ -f "${join(root, "setsid-ready")}" ] && break; sleep 0.01; done`, | ||
| 'printf "count=1\n" > "$HOME/.config/fakeapp/state.ini"', |
There was a problem hiding this comment.
Readiness wait can fall through
The loop writes count=1 after 100 attempts even when a child is not ready. The other installProcessFamily caller—the session-failure test—still starts cleanup based only on count=1. If child startup takes longer than this wait on a busy runner, cleanup can send SIGTERM before the child's trap is installed, leaving the same missing-marker flake.
Require both markers before publishing count=1, and report a clear startup failure if the wait expires.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/application/desktop/DesktopApplicationCapture.test.ts
Line: 147-148
Comment:
**Readiness wait can fall through**
The loop writes `count=1` after 100 attempts even when a child is not ready. The other `installProcessFamily` caller—the session-failure test—still starts cleanup based only on `count=1`. If child startup takes longer than this wait on a busy runner, cleanup can send `SIGTERM` before the child's trap is installed, leaving the same missing-marker flake.
Require both markers before publishing `count=1`, and report a clear startup failure if the wait expires.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e026edf19a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| !fileExists(join(root, "group-ready")) || | ||
| !fileExists(join(root, "setsid-ready")) | ||
| ) |
There was a problem hiding this comment.
Fail promptly when the readiness handshake is absent
On the Linux source-test path, if either child never creates its readiness marker (for example, the setsid launch fails), this callback keeps returning undefined while fakeapp loops. The capture's 60-second duration exceeds the source Vitest deadline of 30 seconds, so the test times out before reaching its cleanup assertions. Add a bounded failure or stop outcome for a missing marker instead of polling until the test runner kills the case.
AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.
…re exercising sigterm release Fixes #10366 Supersedes #10455 Co-Authored-By: gensokyo-dev <[email protected]>
…re exercising sigterm release Fixes #10366 Supersedes #10455 Co-Authored-By: gensokyo-dev <[email protected]>
|
Thank you! Your readiness wait landed in #10568 as 97c7582 (rebase-merged, authorship kept), which fixes #10366. Follow-ups a422353 and 1ba93b4 make the synthetic app fail visibly, and the test fail promptly, when its children never get ready instead of the wait giving up silently. Closing as superseded. |
Summary
Fixes #10366.
The synthetic Linux desktop cleanup test sent
SIGTERMat 1.5 seconds afterstate.iniwas written, but it never verified that the fake application's child processes (the same-group trap child and thesetsidchild) had installed theirTERMhandlers by the time the signal arrived. One CI job observed a flake wheresetsid-termwas absent even though the cleanup contract was fulfilled and the same test succeeded on a retry of the same run.Change and scope
state.iniand before entering its main loop. Both childrentoucha*-readymarker immediately after installing their trap; a boundedfor i in $(seq 1 100)loop in the parent waits for both markers (≤ ~1 s, typically ≤ 20 ms).nextRequestcallback in the stop test now returns{ kind: "stop" }only whenstate.inishowscount=1AND both readiness markers exist — socaptureDesktopApplicationnever exercises termination before the children are ready to terminate.group-termandsetsid-termmarkers are still required after the process release, and{ verified: true, reason: null }is still required.Evidence and regression coverage
npx vitest run src/application/desktop/DesktopApplicationCapture.test.ts— 32 passed.npm run typecheck— passed.npm run format:check— passed.npm run lint— passed.Remaining proof gaps
Compatibility, safety, and release
Author readiness
Human owner: @LexLuthorPrimero