Skip to content

test: wait for exec and readiness in containment and browser cleanup tests - #304

Merged
ElbertePlinio merged 7 commits into
mainfrom
fix/260-292-297-core-browser-test-flakes
Oct 8, 2026
Merged

ElbertePlinio merged 7 commits into
mainfrom
fix/260-292-297-core-browser-test-flakes

Conversation

@ElbertePlinio

@ElbertePlinio ElbertePlinio commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Three core and browser test flakes fixed in test code only.

#292: spawn can return while execve is still running, and until then /proc/<pid>/environ reads as empty. Under load this window reached the containment cleanup's first membership proof. In the recycled-pid test, that moved the test's trigger into the proof before the freeze, so the refusal reason changed. In the proven-member test, the exec finished between two reads. The simulated members now start only after /proc/<pid>/environ shows their environment. No assertion or refusal changed. The second case also exposed a product false refusal, filed as #299. A comment at waitForExec states that the test excludes that transition and names #299.

#297: the stubborn-stall fake Chrome wrote chrome.pid before it installed its signal handlers, and the test waited a fixed 50 ms. The fake now installs its handlers first, and the test waits for the pid marker. Its CDP timeout now covers the fake's startup, because the test ends startup itself by killing the leader.

#260: the pre-identity cleanup test needs a live Chrome in the group when the product's 1 s identity window closes. Under load, Chrome had not started yet. The mocked startDaemon now returns the Chrome handle only after chrome.pid exists, with a 20 s bound, so the test always exercises a live leftover Chrome.

Closes #260
Closes #292
Closes #297

Requirement Verified by Scenario Result Evidence
#292 find why the recycled pid is classified as foreign Trace, forced reproduction Stat env_end 0 and empty environ on the first proof; forced mid-exec on the first proof Reproduced the reported failure exactly ~/Artifacts/pickforge-batch3-2026-10-08/worker-D-report.md
#292 find why the proven-member scope is not removed Trace Exec completed between the environ and stat reads Product false refusal, filed as #299 worker-D-report.md
#292 fix the test timing, keep the refusal Repeat runs 32 busy loops, 16 core-suite runs origin/main 14 of 16 (the two reported failures); fixed 16 of 16 worker-D-pf-flakes
#297 readiness after the handlers Probe, forced delay, repeat runs Handlers missing at the old 50 ms point in 1 of 10 loaded runs; 1.5 s injected delay Old went ahead without handlers 3 of 3; new waited 3 of 3; 10 of 10 under load worker-D-pf-flakes
#260 hold the window until the marker exists Repeat runs 32 busy loops on 2 CPUs origin/main failed 10 of 10; fixed 10 of 10 worker-D-pf-flakes
Reap-race CDP window covers fake startup (review round 1) Repeat runs 16 busy loops on 2 pinned CPUs 10 of 10 passed worker-D-report.md
Repo checks lint, typecheck, build, PickCheck, coverage Coverage on 33c2a13 on a quiet host; PickCheck after the helper refactor All pass; 2968 tests, thresholds hold ~/Artifacts/pickforge-batch3-2026-10-08/260-292-297-core-browser-test-flakes-cov.log

QA device pass: skipped. The change is test code only, so there is nothing to drive.

… race

The supervisor reap race test waited a fixed 50 ms for the stubborn-stall
fake Chrome to install its signal handlers. The fake wrote chrome.pid
before it installed them. Under load, a probe at the 50 ms point found
the handlers missing in 1 of 10 runs, so a signal could reach the fake
before the handlers existed.

The fake now installs its handlers before it writes chrome.pid. The test
waits until chrome.pid holds the child pid instead of a fixed delay.

Closes #297
The product waits 1 s for the supervisor identity, which the mock never
returns, and then kills the group. On a starved host that window closed
before the supervisor had spawned fake Chrome, so chrome.pid never
appeared and the test never covered a live leftover Chrome.

The mocked startDaemon now returns the Chrome handle only after
chrome.pid exists or the supervisor exits. The identity window then
always opens with a live Chrome in the group.

Closes #260
spawn can return while execve is still running. Until the kernel sets
env_end, /proc/<pid>/environ reads as empty. Under load, that window
reached destroy's first membership proof.

In the recycled-pid test the cleanup retried the mid-exec member. That
moved the test's procsReads === 3 trigger into the pre-freeze proof, so
the frozen proof saw the replacement token and refused it as foreign
instead of as a recycled pid. In the proven-member test the exec
finished between the environ read and the stat read, so the member was
refused as foreign and the scope was not removed.

The spawn helpers now block until the new image shows the PATH that
spawn gave it. The refusals stay as they were.

Closes #292
@ElbertePlinio
ElbertePlinio merged commit 6cbca81 into main Oct 8, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the fix/260-292-297-core-browser-test-flakes branch October 8, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant