Skip to content

test(desktop): wait for process-family handler readiness - #10383

Closed
kaoru0822-kitauji wants to merge 3 commits into
mainfrom
test/10366-desktop-child-readiness-c7-01a1d00b
Closed

kaoru0822-kitauji wants to merge 3 commits into
mainfrom
test/10366-desktop-child-readiness-c7-01a1d00b

Conversation

@kaoru0822-kitauji

@kaoru0822-kitauji kaoru0822-kitauji commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Refs #10366. Replace the process-family fixture's 1.5-second readiness guess with an explicit startup barrier and acknowledgments from both installed TERM handlers. Both capture cases observe the parent state before releasing child startup, then wait for both acknowledgments before requesting shutdown or failure.

The shared child fixture owns handler setup. Preserve main's bounded startup-failure marker and prompt failure reporting in both callbacks; retain the group/detached SIGTERM markers, verified cleanup and failed-session content removal. Production termination and process ownership are unchanged.

Validation

Updated with main 97b017c500; current head includes 9836fe5c6f and fc208d325. Executed on macOS arm64, Node 24.22.1/npm 11.16.0:

  • npm run test:local -- src/application/desktop/DesktopApplicationCapture.test.ts src/process/TokenOwnedTermination.test.ts: 25 passed, 13 skipped. The affected process-family capture cases require Linux and were skipped locally.
  • npm run check:fast: passed.
  • Formatting and git diff --check: passed.

The prior Linux source-test run passed both affected cases on the earlier head. Current-head Linux verification is pending. The old unrelated fingerprint timeout is repaired on main by 62798fa8b0, now included. This change establishes fixture ordering; it does not establish the original intermittent failure's cause or frequency. No live desktop app/provider was exercised.

Author readiness

Human owner: @kaoru0822-kitauji

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-15T10:12:14.029617Z
We couldn’t complete this review. Comment @codex review to try again.
fc208d3 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge, with the existing non-blocking readiness-timeout concern still open.

Findings

  1. P2 Readiness timeout starts too early ▶
Fix with agent prompt
### Issue 1
src/application/desktop/DesktopApplicationCapture.test.ts:161-163
The parent starts its roughly five-second readiness wait before the test releases `start-children`. Both children must wait for `nextRequest` to release that file, but requests run between process, window, and open-file scans. If a scan delays the next request past that wait, the parent writes `children-not-ready` and exits before the children are allowed to start. This leaves a non-blocking source of failures on slow Linux runners in both tests.

Wait for the barrier before starting the bounded readiness check.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Replaces the process-family tests’ fixed delay with a shared child script and explicit startup signals.

  • Process-family capture tests wait for both child handlers to be ready.

Reviews (4) · Last reviewed commit: "test(desktop): keep readiness timeout in..." · Reviewed by Greptile

Copy link
Copy Markdown
Collaborator Author

Final author-wide sweep: failed shard 1/8 (job 131994362258, run 43456196624) fails only the old fingerprint fixture, not the desktop readiness cases. Both fingerprint cases exceed 30 s (44.505 s direct / 47.909 s transferred); shard result is 2 failed / 2,307 passed / 43 skipped.

This is the shared #10381 blocker. Common repair #10384 at ae34c21da30ca05fade01e728242b0b628fdc536 is fully green: 21 successful checks / 26 deliberate skips. Its actual Ubuntu shard 3 passes both large cases at 22.753 s / 21.766 s, with all regression assertions retained and no test deadline increase. The new shared preparation hook uses its explicitly documented 30 s budget.

Please incorporate that common repair into your owned branch, or refresh after it lands on main, before recording this PR's CI as passing. I am leaving your branch untouched to avoid a collision; no unchanged-head retry was performed or claimed.

Copy link
Copy Markdown
Collaborator Author

I am preparing an isolated integration of the green common repair ae34c21 with this exact PR head, using session-owned branch codex/n13-1416-integrate-10383. I will run the affected regressions and provide the resulting ref for your integration. Your published branch remains under your ownership; no push to it is planned.

kaoru0822-kitauji commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator Author

Final evidence for the shared CI repair; your published branch is unchanged.

  • Pinned peer head: f606963dd8b453eddc7da0c8b9e7f0087e1a01f3.
  • Historical session-owned integration: codex/n13-1416-integrate-10383 at 2864514164fb5334d2aa9ccfc898e3eb882cd8fc, combining your exact feature with the earlier deadline policy. Local Node 24.22.1/npm 11.16.0: 42 tests pass / 13 Linux-specific skips in seven exact local files with V8 coverage; full static checks and normal hooks pass.
  • Full two-worker desktop/policy qualification completed all six coverage shards and portable reports: 48,888 passed / 290 deliberate skips. All 32 Linux desktop-source cases pass. The three previously failing wide JavaScript cases pass in shard 4. The aggregate gate fails solely because Apple exceeded its existing 15-minute job cap. A new Linux full run of the XML policy merge is not claimed.

The canonical replacement is now #10391 at 82df66d631c69d88d6a30cf2f72cc44fed6fe446, rebased with main’s hosted-runner worker change. Our private compatibility tree matched that head byte-for-byte and passes 20 deadline/config probes in each coverage mode, full static checks, and docs checks. Current-head CI has completed its test executions with two confirmed failures: the source ZIP-model case exceeded 30 seconds, and the DMG recovery CLI child exceeded its separate 30-second harness budget. The aggregate CI job is still queued. The owner has source failure evidence and native DMG measurements; the older full results do not qualify the new worker policy.

#10384 is closed as superseded; #10381 stays open pending a landed replacement. After #10391 lands, refreshing this PR from main keeps its diff independent. The historical helper refs above predate that main update. No peer branch was pushed, duplicate PR opened, or human review attested.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

Comment on lines 161 to +163
'printf "count=1\\n" > "$HOME/.config/fakeapp/state.ini"',
// Bound failed child startup after the caller releases the fixture barrier.
`ready=; for i in $(seq 1 500); do if [ -f "${join(root, "group-ready")}" ] && [ -f "${join(root, "setsid-ready")}" ]; then ready=1; break; fi; sleep 0.01; done; [ -n "$ready" ] || { echo "synthetic children did not report ready" >&2; touch "${join(root, "children-not-ready")}"; exit 97; }`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Readiness timeout starts too early

The parent starts its roughly five-second readiness wait before the test releases start-children. Both children must wait for nextRequest to release that file, but requests run between process, window, and open-file scans. If a scan delays the next request past that wait, the parent writes children-not-ready and exits before the children are allowed to start. This leaves a non-blocking source of failures on slow Linux runners in both tests.

Wait for the barrier before starting the bounded readiness check.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/application/desktop/DesktopApplicationCapture.test.ts
Line: 161-163

Comment:
**Readiness timeout starts too early**

The parent starts its roughly five-second readiness wait before the test releases `start-children`. Both children must wait for `nextRequest` to release that file, but requests run between process, window, and open-file scans. If a scan delays the next request past that wait, the parent writes `children-not-ready` and exits before the children are allowed to start. This leaves a non-blocking source of failures on slow Linux runners in both tests.

Wait for the barrier before starting the bounded readiness check.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@morluto morluto added the area: tests Test suite and verification label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Test suite and verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants