renderer: sandbox fix round 2 (fail closed without a held init; cancel)
Astra's task 5 review, round 2: two findings, both fixed. Termination fails closed. identify(pid, monitor) replaces the pidfd step and says one of three things. Held: a pidfd whose process, read after the open, has bubblewrap's unreaped monitor as parent (the monitor forks only the init, which held that PID before the open). Gone: no process at the PID (pidfd_open ESRCH, /proc ENOENT or ESRCH), so the init and its whole namespace have ended. Unknown: anything else, which covers no pidfd (EMFILE, EPERM), an unreadable parent, another parent (the monitor exited and the init moved) and no PID. On unknown, start kills bubblewrap, waits for it and fails with ErrNotEnded; no Sandbox is returned. Launch also refuses a gone init (the sandbox is over, whatever it said) and treats a cancel that races ready as a cancel. Cancellation bounds startup. start checks ctx before reading the tree and again just before the fork. The info read (now a bounded incremental read) gets a deadline infoGrace (200 ms) after ctx is done; without a PID by then bubblewrap is killed, what it wrote before dying is still read, and the result is identified as above, so a cancel either ends with the init held, killed and shown to have ended, or with ErrNotEnded. Once identified, context.AfterFunc kills the sandbox on cancel. Errors are wrapped with %w, so errors.Is finds ErrNotEnded, context.Canceled and os.ErrDeadlineExceeded. Seams for tests: pidfdOpen, readParent, testBeforeIdentity(monitor). Tests (CGO_ENABLED=0, sandbox off; task 6's untracked files and its sandbox_linux.go edit hidden with go test -overlay): go test ./internal/runner/render/ -count=1 33 pass, 1 skip EQUIPO_RENDERER_TREE=<rebuilt tree> ... -run TestLaunchRealBrowser pass New: TestIdentify (10 cases of the rule, the pidfd closed unless held), TestLaunchFailsClosedWithoutAPidfd (EMFILE), ...WhenTheParentIsUnreadable (EIO), ...WhenTheMonitorLeftFirst (monitor killed to a zombie before identification; kernel answers fixed), TestLaunchNeverClaimsAnUnprovenEnd (the same with the kernel's real answers, 5 rounds: no sandbox, and without ErrNotEnded nothing of it runs), TestLaunchAlreadyCancelled (nothing forked), TestLaunchCancelledAtFork (a stalling fake bubblewrap never starts), TestLaunchCancelledWhileAwaitingInfo (returns within 3 s with Canceled and ErrNotEnded, bubblewrap dead), TestLaunchTimesOutAwaitingInfo, TestLaunchCancelledOnceTheInitIsHeld (10 rounds: Canceled, not ErrNotEnded, nothing runs), TestContextEndsTheSandbox. RED: the new tests against round 1's rules, applied as mutations: pidfd error read as ended: TestIdentify, FailsClosedWithoutAPidfd; other parent read as ended: TestIdentify, MonitorLeftFirst, ParentIsUnreadable; no ctx checks: AlreadyCancelled, CancelledAtFork; info read deaf to ctx: CancelledWhileAwaitingInfo (30 s). Mutations (scripted, each applied once, file restored by checksum): - pidfd error read as gone; unknown parent read as gone; parent not compared; ENOENT not gone; ESRCH not gone: TestIdentify (+ the FailsClosed tests where they apply) - unknown init returns a sandbox: the three FailsClosed tests - unknown init without ErrNotEnded: FailsClosed tests, CancelledWhileAwaitingInfo, TimesOutAwaitingInfo - unknown init not killed: the package hangs (timeout at 2m30s) - awaitEnd treats unknown as ended: survived, layered (start never returns an unknown init) - no ctx check at start: AlreadyCancelled; before the fork: CancelledAtFork; info read ignores ctx: CancelledWhileAwaitingInfo; no kill on ctx once held: ContextEndsTheSandbox - Launch returns a gone sandbox: NeverClaimsAnUnprovenEnd 10/10 runs - ready wins over a cancel: CancelledOnceTheInitIsHeld 5/5 runs (ten rounds each; a single round caught it in 6 of 10) - round 1 rechecked: Close does not wait, no --info-fd, bubblewrap started directly: still killed Gates: darwin/arm64 build and vet, linux arm64 vet, staticcheck on a clean HEAD copy with these files, dead-reference scan (known doc lines only).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 files changed,
+539
−58
internal/runner/render/helpers_linux_test.go+8 −0internal/runner/render/launch_linux.go+159 −53internal/runner/render/launch_linux_test.go+354 −0internal/runner/render/render.go+18 −5
CI failed — run details
CI log
=== prepare ===
ci-box: machine: aarch64, 32 CPUs, 62 GiB memory, kernel 7.0.0-1017-aws
ci-box: python 3.12.3; Docker version 29.1.3, build 29.1.3-0ubuntu3~24.04.2
ci-box: user namespaces allowed: 233151
ci-box: cgroup: cgroup2fs
ci-box: disk /home/ci/work/repos/oficina__equipo/wt/specialists-slice-1: Type Size Avail | ext4 96G 84G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type Size Avail | ext4 96G 84G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 2.0s
ci-box: codex: fetched and verified in 3.4s
ci-box: codex-code-mode-host: fetched and verified in 1.3s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.3s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 10.0s
ci-box: pi: installed and verified in 7.4s
ci-box: opencode: installed and verified in 2.1s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 8.7s
ci-box: clone deepened in 5.6s
ci-box: file times set from content: 3308 files, 214 directories
ci-box: ready in 18.9s
=== copy ===
EQUIPO_RELEASE_COPY_CHECK=1 CGO_ENABLED=0 go test ./internal/equipotest -run '^TestReleaseCopyReviewed$' -count=1
ok amadan.net/oficina/equipo/internal/equipotest 0.154s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
5.6s
+ go list -export -test -tags testbuild -f ./...
5.4s
+ go list -export -test -tags browser,testbuild -f ./internal/equipo ./internal/equipotest ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
3.7s
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -version
staticcheck 2026.1 (v0.7.0)
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 -version
Go: go1.26.11
Scanner: govulncheck@v1.8.0
DB: https://vuln.go.dev
DB updated: 2026-11-24 15:56:00 +0000 UTC
go run github.com/zricethezav/gitleaks/v8@v8.30.1 version
version is set by build process
=== check ===
--- shard 0 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-work: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$' ./internal/headless
receipt: test step 1m21.147s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m18.64s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m18.64s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 67.12, cpu waiting 40.10%, memory waiting 0.00%, io waiting 0.45%
--- shard 1 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-review: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$' ./internal/headless
receipt: test step 1m20.817s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m18.145s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m18.14s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 67.12, cpu waiting 40.10%, memory waiting 0.00%, io waiting 0.45%
--- shard 2 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-connections: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$' ./internal/headless
receipt: test step 1m20.725s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m18.488s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m8.86s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.12s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.5s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 67.12, cpu waiting 39.87%, memory waiting 0.00%, io waiting 0.43%
--- shard 3 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-mac: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$' ./internal/headless
receipt: test step 1m17.563s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m15.407s amadan.net/oficina/equipo/internal/headless
receipt: slow test 37.77s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 19.41s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.12s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 9.1s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 68.44, cpu waiting 40.34%, memory waiting 0.00%, io waiting 0.47%
--- shard 4 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-guards: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_step_refused$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
receipt: test step 1m36.552s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m34.147s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m3.87s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.6s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 8.48s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 7.28s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 4.91s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 65.45, cpu waiting 38.60%, memory waiting 0.00%, io waiting 0.34%
--- shard 5 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-rest: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$|^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$|^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$|^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$|^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_step_refused$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
receipt: test step 2m59.031s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2m56.303s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m40.18s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 20.24s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.22s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 7.07s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistantAttachments
receipt: slow test 6.81s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 23.50, cpu waiting 10.49%, memory waiting 0.00%, io waiting 0.08%
--- shard 6 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest
receipt: test step 2m17.179s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2m14.844s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 10.15s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.75s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 5.09s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 3.88s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 2.69s amadan.net/oficina/equipo/internal/thintest TestContractTeamUpdatePersonNeeds
machine: 32 CPUs, load 42.13, cpu waiting 20.35%, memory waiting 0.00%, io waiting 0.16%
--- shard 7 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest-contract: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest
receipt: test step 1m59.575s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m57.54s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.54s amadan.net/oficina/equipo/internal/thintest TestContractRetryPreviewUnverifiedMerge
receipt: slow test 9.06s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 4.96s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.67s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 3.03s amadan.net/oficina/equipo/internal/thintest TestContractPausedJob
machine: 32 CPUs, load 51.08, cpu waiting 27.22%, memory waiting 0.00%, io waiting 0.23%
--- shard 8 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-thin: ./internal/runner/thin
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/runner/thin
budget note: internal/runner/thin took 5m13.412s, over the 45s its record on line 44 allows; reported only, timing fails on CI
receipt: test step 5m19.385s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 5m13.412s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 37.04s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.9s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.8s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.48s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 9.99s amadan.net/oficina/equipo/internal/runner/thin TestTimeoutKeepsNothingForAnOlderInstance
machine: 32 CPUs, load 4.08, cpu waiting 1.01%, memory waiting 0.00%, io waiting 0.00%
--- shard 9 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-bug: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$' ./internal/runner
receipt: test step 51.624s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 50.626s amadan.net/oficina/equipo/internal/runner
receipt: slow test 30.59s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.03s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 54.63, cpu waiting 34.28%, memory waiting 0.00%, io waiting 0.72%
--- shard 10 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-plans: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner
receipt: test step 1m2.441s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m1.128s amadan.net/oficina/equipo/internal/runner
receipt: slow test 51.08s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 47.35s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.42s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.62s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 67.95, cpu waiting 39.53%, memory waiting 0.00%, io waiting 0.61%
--- shard 11 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-rest: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$|^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner
receipt: test step 36.641s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 35.647s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.13s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.27s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 3.13s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 3.09s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestCoordinatorTransientRefusalKeepsServing
machine: 32 CPUs, load 33.28, cpu waiting 22.06%, memory waiting 0.00%, io waiting 0.95%
--- shard 12 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-a started 30s late; cpu waiting 40.8%, load 25.99
test lane equipotest-a: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' ./internal/equipotest
--- FAIL amadan.net/oficina/equipo/internal/equipotest TestDirectDeadReferencesRepository
=== RUN TestDirectDeadReferencesRepository
direct_cutover_test.go:221: repository reference inventory: exit status 1
docs/superpowers/plans/2026-11-28-dynamic-specialists-slice-1.md:109:5: unclassified equipo-runner
docs/superpowers/plans/CONTROLLER-BRIEF-specialists-slice-1.md:84:25: unclassified Paseo
docs/superpowers/specs/2026-11-28-dynamic-specialists.md:224:15: unclassified equipo-runner
reference scan: 3020 text files, 3232 matches, 3 failures
--- FAIL: TestDirectDeadReferencesRepository (2.32s)
--- FAIL amadan.net/oficina/equipo/internal/equipotest (package output)
FAIL
rastrillo-budget/v1 ran 1m8.14s
FAIL amadan.net/oficina/equipo/internal/equipotest 68.473s
receipt: test step 1m10.372s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 1m8.14s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 29.32s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 29.26s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 27.06s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 24.09s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 23.88s amadan.net/oficina/equipo/internal/equipotest TestAuthorityReadsOneSnapshot
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' -v -run '^TestDirectDeadReferencesRepository$' -count=1 ./internal/equipotest (retry, once)
FAILED TWICE ./internal/equipotest:TestDirectDeadReferencesRepository equipotest-a
=== RUN TestDirectDeadReferencesRepository
direct_cutover_test.go:221: repository reference inventory: exit status 1
docs/superpowers/plans/2026-11-28-dynamic-specialists-slice-1.md:109:5: unclassified equipo-runner
docs/superpowers/plans/CONTROLLER-BRIEF-specialists-slice-1.md:84:25: unclassified Paseo
docs/superpowers/specs/2026-11-28-dynamic-specialists.md:224:15: unclassified equipo-runner
reference scan: 3020 text files, 3232 matches, 3 failures
--- FAIL: TestDirectDeadReferencesRepository (2.27s)
FAIL
rastrillo-budget/v1 ran 2.266s
FAIL amadan.net/oficina/equipo/internal/equipotest 2.428s
FAIL
machine: 32 CPUs, load 58.80, cpu waiting 34.67%, memory waiting 0.00%, io waiting 0.30%
make: *** [Makefile:113: ci-shard] Error 1
amadan: step check shard 12 of 29 failed: exit status 2
--- shard 13 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-e started 30s late; cpu waiting 40.8%, load 25.99
test lane equipotest-e: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[E-P]' ./internal/equipotest
receipt: test step 2m14.81s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2m12.493s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 21.2s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 21.19s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 21.18s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 21.16s amadan.net/oficina/equipo/internal/equipotest TestProjectsAccountRevisionAndValidation
receipt: slow test 21.13s amadan.net/oficina/equipo/internal/equipotest TestProjectRetryAndRevision
machine: 32 CPUs, load 28.39, cpu waiting 13.25%, memory waiting 0.00%, io waiting 0.10%
--- shard 14 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-r started 30s late; cpu waiting 40.8%, load 25.99
test lane equipotest-r: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestR' ./internal/equipotest
budget note: internal/equipotest took 5m32.72s, over the 5m0s its record on line 15 allows; reported only, timing fails on CI
receipt: test step 5m38.592s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 5m32.72s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 4m40.25s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.37s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.38s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 10.33s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 7.27s amadan.net/oficina/equipo/internal/equipotest TestRosterProtectsLastOwner
machine: 32 CPUs, load 2.50, cpu waiting 0.43%, memory waiting 0.00%, io waiting 0.00%
--- shard 15 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-rest started 30s late; cpu waiting 40.8%, load 25.99
test lane equipotest-rest: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test[A-D]|^TestQ|^Test[E-P]|^TestR' ./internal/equipotest
receipt: test step 1m10.598s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m8.239s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 26.43s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 25.85s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 25.81s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 24.01s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsRollbackAndUnavailable
receipt: slow test 23.9s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsUpgrade
machine: 32 CPUs, load 61.57, cpu waiting 36.82%, memory waiting 0.00%, io waiting 0.32%
--- shard 16 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: plan3test started 30s late; cpu waiting 40.8%, load 25.99
test lane plan3test: ./internal/plan3test
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/plan3test
receipt: test step 56.448s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 54.119s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.87s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.51s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.8s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.58s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.34s amadan.net/oficina/equipo/internal/plan3test TestPlanMigrationUpgrade
machine: 32 CPUs, load 68.23, cpu waiting 39.78%, memory waiting 0.00%, io waiting 0.41%
--- shard 17 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: rest started 30s late; cpu waiting 40.8%, load 25.99
test lane rest: ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/diffscan ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/github ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/render ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/diffscan ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/github ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/render ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude/realcli: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/webread: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runnerproto: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
budget note: internal/equipo took 2m25.304s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 23.708s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/github took 40.581s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/equipo/setup took 12.291s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/idtest took 1m59.875s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 39.941s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/containment took 1m1.701s, over the 15s its record on line 40 allows; reported only, timing fails on CI
budget note: internal/runner/forge took 26.26s, over the 20s its record on line 35 allows; reported only, timing fails on CI
budget note: internal/runner/provider/claude/realcli took 14.299s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/provider/pi took 1m23.379s, over the 1m0s its record on line 27 allows; reported only, timing fails on CI
budget note: internal/runner/render took 1m15.679s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 2m30.738s against a 60s target (the gate's other steps are not in this figure)
receipt: 29 packages ran, 41 cached, 16 without tests, 0 failed
receipt: slow package 2m25.304s amadan.net/oficina/equipo/internal/equipo
receipt: slow package 1m59.875s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 1m23.379s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 1m15.679s amadan.net/oficina/equipo/internal/runner/render
receipt: slow package 1m11.492s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow test 56.86s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 50.34s amadan.net/oficina/equipo/internal/runner/render TestLaunchNeverClaimsAnUnprovenEnd
receipt: slow test 47.74s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 47.71s amadan.net/oficina/equipo/internal/idtest TestDoorNeverJudgesANativeSession
receipt: slow test 46.6s amadan.net/oficina/equipo/internal/idtest TestDoorForgetsOficinaIDForARefusedSession
machine: 32 CPUs, load 23.50, cpu waiting 10.15%, memory waiting 0.00%, io waiting 0.08%
--- shard 18 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-chat: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$' ./internal/headless
receipt: test step 1m26.343s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m24.587s amadan.net/oficina/equipo/internal/headless
receipt: slow test 38.84s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 14.92s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.9s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.37s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 6.49s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 68.23, cpu waiting 39.59%, memory waiting 0.00%, io waiting 0.39%
--- shard 19 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-work: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$' ./internal/headless
receipt: test step 1m33.929s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m31.703s amadan.net/oficina/equipo/internal/headless
receipt: slow test 29.2s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 21.24s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 13.29s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 9.79s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
receipt: slow test 9.4s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
machine: 32 CPUs, load 65.45, cpu waiting 38.93%, memory waiting 0.00%, io waiting 0.35%
--- shard 20 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-connections: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
receipt: test step 1m54.667s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m52.768s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.72s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.36s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 13.09s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 11.26s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsSignInEmail
receipt: slow test 11.17s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
machine: 32 CPUs, load 54.23, cpu waiting 29.00%, memory waiting 0.00%, io waiting 0.24%
--- shard 21 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-rest: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserCardAnswerSettlesAtBottom|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInEmail|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
receipt: test step 1m39.376s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m37.555s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.07s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 12.98s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.98s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 9.63s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.46s amadan.net/oficina/equipo/internal/headless TestBrowserRefreshRace
machine: 32 CPUs, load 61.57, cpu waiting 36.82%, memory waiting 0.00%, io waiting 0.32%
--- shard 22 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-rest: ./internal/equipo
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserPreviewBlocksNavigation|TestBrowserPreviewPassExchange)$' ./internal/equipo
receipt: test step 4.422s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2.472s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 1.83s amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewPassExchange
receipt: slow test 640ms amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewBlocksNavigation
browser lane browser-rest: ./internal/equipotest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserGitHubManifestCSP)$' ./internal/equipotest
receipt: test step 7.966s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 6.322s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 6.32s amadan.net/oficina/equipo/internal/equipotest TestBrowserGitHubManifestCSP
browser lane browser-rest: ./internal/idtest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserOficinaIDDoor|TestBrowserSmartDoor)$' ./internal/idtest
budget note: internal/idtest took 10.846s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 12.389s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 10.846s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 8.6s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 2.24s amadan.net/oficina/equipo/internal/idtest TestBrowserOficinaIDDoor
browser lane browser-rest: ./internal/plan3test
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestTeamsHierarchyBrowser)$' ./internal/plan3test
receipt: test step 4.009s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2.36s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2.36s amadan.net/oficina/equipo/internal/plan3test TestTeamsHierarchyBrowser
browser lane browser-rest: ./internal/thintest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAccessEmojiByline|TestBrowserAccessFinalOutcomes|TestBrowserAccessRequest|TestBrowserAccessReview|TestBrowserActivitySubjects|TestBrowserAutonomySettings|TestBrowserCoordinatorQueue|TestBrowserEmptyConversation|TestBrowserEndedNoteStaysGone|TestBrowserHousekeeping|TestBrowserInnerGallery|TestBrowserInnerScreens|TestBrowserInstantThinking|TestBrowserInstantThinkingQueued|TestBrowserMachines|TestBrowserPausedWork|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|TestBrowserRhythm|TestBrowserRollup|TestBrowserRosterAlignment|TestBrowserRosterDecisionStates|TestBrowserRosterQuietDay|TestBrowserRosterReports|TestBrowserRosterSetAside|TestBrowserRosterSubchat|TestBrowserRosterThinking|TestBrowserRosterVisual|TestBrowserSettingsHousekeepingGroups|TestBrowserSettingsMenu|TestBrowserSettingsRail|TestBrowserSettingsSaveBar|TestBrowserSettingsShots|TestBrowserSettingsStayOnPage|TestBrowserSettingsTeams|TestBrowserShipsButtons|TestBrowserSpecialistRows|TestBrowserSpendFollowsAnswers|TestBrowserTaskRows|TestBrowserTeamPanel|TestBrowserThinkingCycles|TestBrowserThinkingLinesClear|TestBrowserThinkingSteady|TestBrowserThinkingWords|TestBrowserTokenRowEmail|TestBrowserTrackPulse|TestBrowserTrackStarCentre|TestBrowserTryAgain)$' ./internal/thintest
receipt: test step 3m36.395s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3m33.599s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 25.79s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.44s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.04s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.7s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.14s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 9.52, cpu waiting 3.27%, memory waiting 0.00%, io waiting 0.02%
--- shard 23 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 23: make test-quarantine
python3 scripts/ci-test.py quarantine
quarantine: 12 tests from scripts/ci-quarantine.txt; a failure is retried once, and a pass on the retry is reported as a flake
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^A5_cancel_and_sign_out$|^TestHeadlessConnections$/^C4_claude_sign_in$|^TestHeadlessConnections$/^C5_engineering_failover$|^TestHeadlessConnections$/^C5_engineering_to_codex$|^TestHeadlessConnections$/^C5_engineering_waits$' ./internal/headless (54s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 4.80s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.24s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 9.21s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 9.28s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 27.27s
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^C5_review_auth$|^TestHeadlessConnections$/^C5_review_failover$|^TestHeadlessConnections$/^C5_review_on_codex$|^TestHeadlessConnections$/^C5_review_other_family_first$' ./internal/headless (59s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 15.12s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 12.63s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 10.65s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 18.24s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless (22s)
ok ./internal/headless TestMixedVersions 19.62s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.80s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin (2s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.06s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 67.95, cpu waiting 38.80%, memory waiting 0.00%, io waiting 0.63%
--- shard 24 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 24: make runner-host
python3 scripts/runner-prerequisites.py
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks
receipt: test step 13.342s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 4 without tests, 0 failed
receipt: slow package 7.808s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 286ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 131ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow test 5.53s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.82s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 350ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 290ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/provider/codex TestDirectJournalAdapterBarrier
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run '^TestNamespace' -count=1 ./internal/runner/containment
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run '^TestNamespace' -count=1 ./internal/runner/containment
receipt: test step 4.195s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3.175s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 330ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 230ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 140ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceExitStatus
machine: 32 CPUs, load 20.49, cpu waiting 11.15%, memory waiting 0.00%, io waiting 1.28%
--- shard 25 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: runner-dead-references started 30s late; cpu waiting 40.8%, load 25.99
shard 25: make runner-dead-references lanes-check build vet fmt-check spacing budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 3020 text files, 3232 matches, 3 failures
docs/superpowers/plans/2026-11-28-dynamic-specialists-slice-1.md:109:5: unclassified equipo-runner
docs/superpowers/plans/CONTROLLER-BRIEF-specialists-slice-1.md:84:25: unclassified Paseo
docs/superpowers/specs/2026-11-28-dynamic-specialists.md:224:15: unclassified equipo-runner
machine: 32 CPUs, load 25.99, cpu waiting 18.35%, memory waiting 0.00%, io waiting 1.01%
make[1]: *** [Makefile:238: runner-dead-references] Error 1
make: *** [Makefile:113: ci-shard] Error 2
amadan: step check shard 25 of 29 failed: exit status 2
--- shard 26 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: staticcheck started 30s late; cpu waiting 40.8%, load 25.99
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 62.02, cpu waiting 36.96%, memory waiting 0.00%, io waiting 0.68%
--- shard 27 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: govulncheck started 30s late; cpu waiting 40.8%, load 25.99
shard 27: make govulncheck
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
=== Symbol Results ===
No vulnerabilities found.
Your code is affected by 0 vulnerabilities.
This scan also found 1 vulnerability in packages you import and 10
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.
machine: 32 CPUs, load 54.63, cpu waiting 35.78%, memory waiting 0.00%, io waiting 0.70%
--- shard 28 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: gitleaks started 30s late; cpu waiting 40.8%, load 25.99
shard 28: make gitleaks
[90m6:48PM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net
[90m6:49PM[0m [32mINF[0m [1m1274 commits scanned.[0m
[90m6:49PM[0m [32mINF[0m [1mscanned ~69069798 bytes (69.07 MB) in 25.5s[0m
[90m6:49PM[0m [32mINF[0m [1mno leaks found[0m
machine: 32 CPUs, load 62.02, cpu waiting 36.96%, memory waiting 0.00%, io waiting 0.68%
amadan: job failed at step check shards 12, 25 of 29 — its output is above, not at the tail of this log
diff --git a/internal/runner/render/helpers_linux_test.go b/internal/runner/render/helpers_linux_test.go| index 224b069d..588f9d0b 100644 |
| --- a/internal/runner/render/helpers_linux_test.go |
| +++ b/internal/runner/render/helpers_linux_test.go |
| @@ -26,6 +26,14 @@ import ( |
| ) |
| func helperMain(args []string) (int, bool) { |
| + // A bubblewrap that never writes its info: it says it started (its |
| + // PID, in "started" beside it) and sleeps, holding every descriptor. |
| + if len(args) > 0 && filepath.Base(args[0]) == "fake-bwrap-stall" { |
| + os.WriteFile(filepath.Join(filepath.Dir(args[0]), "started"), []byte(strconv.Itoa(os.Getpid())), 0o600) |
| + for { |
| + time.Sleep(time.Hour) |
| + } |
| + } |
| if len(args) > 1 && filepath.Base(args[0]) == filepath.Base(BrowserPath) && args[1] == "--writer" { |
| return writerMain(), true |
| } |
diff --git a/internal/runner/render/launch_linux.go b/internal/runner/render/launch_linux.go| index abea0999..11a2ecd9 100644 |
| --- a/internal/runner/render/launch_linux.go |
| +++ b/internal/runner/render/launch_linux.go |
| @@ -9,7 +9,6 @@ import ( |
| "encoding/json" |
| "errors" |
| "fmt" |
| - "io" |
| "os" |
| "os/exec" |
| "path/filepath" |
| @@ -79,15 +78,24 @@ func Launch(ctx context.Context, cfg LaunchConfig) (*Sandbox, error) { |
| if err != nil { |
| return nil, err |
| } |
| + if s.state == initGone { |
| + // The init ended before it could be held: whatever it said, the |
| + // sandbox is over. |
| + s.Close() |
| + return nil, fmt.Errorf("render: the sandbox ended before it was ready: %s", bytes.TrimSpace(s.stderr.Bytes())) |
| + } |
| timer := time.NewTimer(startTimeout(cfg)) |
| defer timer.Stop() |
| select { |
| case st := <-s.ready: |
| - if st.Event == "ready" { |
| + if st.Event == "ready" && ctx.Err() == nil { |
| s.Site = st.Site |
| return s, nil |
| } |
| err = fmt.Errorf("render: the sandbox failed (%s)", st.Reason) |
| + if ctx.Err() != nil { |
| + err = ctx.Err() |
| + } |
| case <-s.done: |
| select { |
| case st := <-s.ready: |
| @@ -101,7 +109,7 @@ func Launch(ctx context.Context, cfg LaunchConfig) (*Sandbox, error) { |
| err = ctx.Err() |
| } |
| if e := s.Close(); e != nil { |
| - err = fmt.Errorf("%w: %v", err, e) |
| + err = fmt.Errorf("%w: %w", err, e) |
| } |
| if s.err != nil { |
| err = fmt.Errorf("%w: %v", err, s.err) |
| @@ -127,18 +135,37 @@ var testBeforeFork func() |
| // killed before Wait and Close report it did not. |
| const endBound = 10 * time.Second |
| +// infoGrace is how long, once ctx is done, the launcher still waits for |
| +// bubblewrap's info: with it the init can be held, killed and shown to |
| +// have ended; without it the end cannot be shown. |
| +const infoGrace = 200 * time.Millisecond |
| + |
| // ErrNotEnded is a sandbox whose processes could not be shown to have |
| -// ended within endBound of being killed. |
| +// ended: its init was never identified (no PID, no pidfd, no way to tell |
| +// the process at that PID is the init), or it did not end within |
| +// endBound of being killed, twice. Some of its processes may still run. |
| var ErrNotEnded = errors.New("render: the sandbox's processes did not end") |
| +// Seams for tests: how a pidfd is opened, a process's parent read and a |
| +// moment before the init is identified. |
| +var ( |
| + pidfdOpen = unix.PidfdOpen |
| + readParent = parentOf |
| + testBeforeIdentity func(monitor int) |
| +) |
| + |
| // start starts the sandbox with argv as its first process (a test runs a |
| // probe in render-sandbox's place) and returns once it holds a pidfd on |
| -// the sandbox's PID namespace init, or knows that init has ended. |
| +// the sandbox's PID namespace init, or knows that init has ended. When |
| +// it can do neither it kills bubblewrap and fails with ErrNotEnded. |
| // |
| // The runner starts its own binary (the descriptor pinned for /runner) |
| // as render-exec, which closes every descriptor it inherited beyond the |
| // launch's and executes bubblewrap. |
| func start(ctx context.Context, cfg LaunchConfig, argv ...string) (*Sandbox, error) { |
| + if err := ctx.Err(); err != nil { |
| + return nil, err |
| + } |
| for _, p := range []string{cfg.Bwrap, cfg.Binary, cfg.Tree, cfg.Site, cfg.Out} { |
| if !filepath.IsAbs(p) || filepath.Clean(p) != p { |
| return nil, fmt.Errorf("render: launch path %q", p) |
| @@ -225,6 +252,11 @@ func start(ctx context.Context, cfg LaunchConfig, argv ...string) (*Sandbox, err |
| if testBeforeFork != nil { |
| testBeforeFork() |
| } |
| + // A request already cancelled starts nothing. |
| + if err := ctx.Err(); err != nil { |
| + started <- err |
| + return |
| + } |
| if err := cmd.Start(); err != nil { |
| started <- err |
| return |
| @@ -257,71 +289,145 @@ func start(ctx context.Context, cfg LaunchConfig, argv ...string) (*Sandbox, err |
| for _, f := range []*os.File{browserIn, browserOut, statusWrite, infoWrite} { |
| f.Close() |
| } |
| - s.watch(infoRead, cmd.Process.Pid, startTimeout(cfg)) |
| + go s.readStatus(statusRead, statusDone) |
| + monitor := cmd.Process.Pid |
| + pid, infoErr := readInfo(ctx, infoRead, startTimeout(cfg)) |
| + killed := false |
| + if infoErr != nil { |
| + // No PID in time, or cancelled: kill bubblewrap, then take what |
| + // it wrote before it died. |
| + cmd.Process.Kill() |
| + killed = true |
| + infoRead.SetReadDeadline(time.Now().Add(time.Second)) |
| + if p, err := readMore(infoRead); err == nil { |
| + pid = p |
| + } |
| + } |
| infoRead.Close() |
| + if testBeforeIdentity != nil { |
| + testBeforeIdentity(monitor) |
| + } |
| + fd, state := identify(pid, monitor) |
| + s.mu.Lock() |
| + s.pidfd, s.state = fd, state |
| + s.mu.Unlock() |
| + // bubblewrap may be reaped now. |
| close(watched) |
| - go s.readStatus(statusRead, statusDone) |
| - go func() { |
| - select { |
| - case <-ctx.Done(): |
| - s.kill() |
| - case <-s.done: |
| + if state == initUnknown { |
| + // Without a held init nothing proves the sandbox ended: kill what |
| + // can be killed, wait for bubblewrap, and fail closed. |
| + if !killed { |
| + cmd.Process.Kill() |
| + } |
| + <-s.done |
| + toBrowser.Close() |
| + fromBrowser.Close() |
| + why := errors.New("render: the sandbox's init could not be identified") |
| + if infoErr != nil { |
| + why = fmt.Errorf("%w: %w", why, infoErr) |
| } |
| + return nil, errors.Join(why, ctxErr(ctx), ErrNotEnded) |
| + } |
| + // From here a cancelled ctx kills the held init (or bubblewrap, for |
| + // an init already gone). |
| + unwatch := context.AfterFunc(ctx, s.kill) |
| + go func() { |
| + <-s.done |
| + unwatch() |
| }() |
| + if infoErr != nil { |
| + // Cancelled or out of time, but the init is held: Close kills it |
| + // and shows it ended. |
| + s.Close() |
| + return nil, errors.Join(fmt.Errorf("render: %w", infoErr), s.ended) |
| + } |
| return s, nil |
| } |
| -// watch reads the init's PID from bubblewrap's info pipe and opens a |
| -// pidfd on it. bubblewrap, the init's parent, is not reaped yet, so a |
| -// process at that PID whose parent is bubblewrap is the init: no other |
| -// process can have that parent. With no PID (bubblewrap failed before |
| -// the sandbox existed) or no such process (the init has ended, and so |
| -// has every process of its namespace), there is nothing to wait for. |
| -func (s *Sandbox) watch(info *os.File, bwrap int, wait time.Duration) { |
| +func ctxErr(ctx context.Context) error { return ctx.Err() } |
| + |
| +// readInfo reads bubblewrap's --info-fd JSON for the init's PID: at most |
| +// 4 KiB, within wait, and once ctx is done, within infoGrace more. |
| +func readInfo(ctx context.Context, info *os.File, wait time.Duration) (int, error) { |
| info.SetReadDeadline(time.Now().Add(wait)) |
| - var msg struct { |
| - ChildPID int `json:"child-pid"` |
| - } |
| - err := json.NewDecoder(io.LimitReader(info, 4096)).Decode(&msg) |
| - if err != nil || msg.ChildPID <= 1 { |
| - if errors.Is(err, os.ErrDeadlineExceeded) { |
| - // A bubblewrap that neither says nor fails: kill it. An init |
| - // it made dies with it (--die-with-parent), but cannot be |
| - // shown to have, so Wait reports ErrNotEnded. |
| - s.cmd.Process.Kill() |
| - s.mu.Lock() |
| - s.noInit = true |
| - s.mu.Unlock() |
| + stop := context.AfterFunc(ctx, func() { info.SetReadDeadline(time.Now().Add(infoGrace)) }) |
| + defer stop() |
| + pid, err := readMore(info) |
| + if err != nil && ctx.Err() != nil { |
| + return 0, ctx.Err() |
| + } |
| + return pid, err |
| +} |
| + |
| +// readMore reads info until it holds a complete JSON object with a |
| +// child-pid above 1, the pipe ends or its deadline passes. |
| +func readMore(info *os.File) (int, error) { |
| + var buf []byte |
| + chunk := make([]byte, 512) |
| + for len(buf) < 4096 { |
| + n, err := info.Read(chunk) |
| + buf = append(buf, chunk[:n]...) |
| + var msg struct { |
| + ChildPID int `json:"child-pid"` |
| } |
| - return |
| + if json.Unmarshal(buf, &msg) == nil && msg.ChildPID > 1 { |
| + return msg.ChildPID, nil |
| + } |
| + if err != nil { |
| + return 0, err |
| + } |
| + } |
| + return 0, errors.New("render: bubblewrap's info is too long") |
| +} |
| + |
| +// identify turns the PID bubblewrap reported for the init into a pidfd |
| +// known to be the init, or shows the init has ended, or neither. |
| +// |
| +// bubblewrap's monitor (monitor) is this process's child and not yet |
| +// reaped, and it forks the init and nothing else, so a process whose |
| +// parent is the monitor is the init. If the process at pid, read after |
| +// the pidfd was opened, has the monitor as parent, it is the init and |
| +// the pidfd is the init's: the init held pid from before the open, so |
| +// the pidfd cannot be some later holder's. No process at pid at all |
| +// (ESRCH, ENOENT) means the init has ended, and the kernel completes an |
| +// init's exit only after killing and reaping its whole namespace. |
| +// Anything else (no pidfd, the parent unreadable, another parent, as |
| +// after the monitor exits and the init is moved to another parent) is |
| +// unknown. |
| +func identify(pid, monitor int) (int, initState) { |
| + if pid <= 1 { |
| + return -1, initUnknown |
| + } |
| + fd, err := pidfdOpen(pid, 0) |
| + if errors.Is(err, unix.ESRCH) { |
| + return -1, initGone |
| } |
| - fd, err := unix.PidfdOpen(msg.ChildPID, 0) |
| if err != nil { |
| - return |
| + return -1, initUnknown |
| } |
| - if parentOf(msg.ChildPID) != bwrap { |
| - unix.Close(fd) |
| - return |
| + ppid, err := readParent(pid) |
| + if err == nil && ppid == monitor { |
| + return fd, initHeld |
| } |
| - s.mu.Lock() |
| - s.pidfd = fd |
| - s.mu.Unlock() |
| + unix.Close(fd) |
| + if errors.Is(err, os.ErrNotExist) || errors.Is(err, unix.ESRCH) { |
| + return -1, initGone |
| + } |
| + return -1, initUnknown |
| } |
| -// parentOf is pid's parent, from /proc, or -1. |
| -func parentOf(pid int) int { |
| +// parentOf is pid's parent, from /proc. |
| +func parentOf(pid int) (int, error) { |
| raw, err := os.ReadFile(fmt.Sprintf("/proc/%d/status", pid)) |
| if err != nil { |
| - return -1 |
| + return 0, err |
| } |
| for _, line := range strings.Split(string(raw), "\n") { |
| if v, ok := strings.CutPrefix(line, "PPid:"); ok { |
| - if n, err := strconv.Atoi(strings.TrimSpace(v)); err == nil { |
| - return n |
| - } |
| + return strconv.Atoi(strings.TrimSpace(v)) |
| } |
| } |
| - return -1 |
| + return 0, errors.New("render: no parent in /proc status") |
| } |
| // kill kills the sandbox: its PID namespace's init (the kernel then kills |
| @@ -342,13 +448,13 @@ func (s *Sandbox) kill() { |
| // it is killed again and given one more endBound; then it is reported. |
| func (s *Sandbox) awaitEnd() error { |
| s.mu.Lock() |
| - fd, noInit := s.pidfd, s.noInit |
| + fd, state := s.pidfd, s.state |
| s.mu.Unlock() |
| - if noInit { |
| - return ErrNotEnded |
| - } |
| - if fd < 0 { |
| + switch { |
| + case state == initGone: |
| return nil |
| + case state != initHeld || fd < 0: |
| + return ErrNotEnded |
| } |
| defer func() { |
| s.mu.Lock() |
diff --git a/internal/runner/render/launch_linux_test.go b/internal/runner/render/launch_linux_test.go| index 684b1e34..7ffe48f5 100644 |
| --- a/internal/runner/render/launch_linux_test.go |
| +++ b/internal/runner/render/launch_linux_test.go |
| @@ -907,3 +907,357 @@ func sandboxedRenderer(pid int) bool { |
| } |
| return false |
| } |
| + |
| +// identify's rules, each observation alone: only a process whose parent |
| +// is the unreaped monitor is held, only no process at the PID is the |
| +// init gone, and everything else is unknown, its pidfd closed. |
| +func TestIdentify(t *testing.T) { |
| + defer func() { pidfdOpen, readParent = unix.PidfdOpen, parentOf }() |
| + const pid, monitor = 4242, 4241 |
| + for name, c := range map[string]struct { |
| + openErr error |
| + parent int |
| + parentErr error |
| + pid int |
| + want initState |
| + }{ |
| + "parent is the monitor": {parent: monitor, want: initHeld}, |
| + "no process at the PID (pidfd)": {openErr: unix.ESRCH, want: initGone}, |
| + "no process at the PID (/proc)": {parentErr: os.ErrNotExist, want: initGone}, |
| + "process gone while read": {parentErr: unix.ESRCH, want: initGone}, |
| + "no pidfd: descriptors exhausted": {openErr: unix.EMFILE, want: initUnknown}, |
| + "no pidfd: not permitted": {openErr: unix.EPERM, want: initUnknown}, |
| + "parent unreadable": {parentErr: unix.EIO, want: initUnknown}, |
| + "another parent (monitor gone)": {parent: 1, want: initUnknown}, |
| + "no PID": {pid: -1, want: initUnknown}, |
| + "PID 1": {pid: 1, want: initUnknown}, |
| + } { |
| + var opened = -1 |
| + pidfdOpen = func(int, int) (int, error) { |
| + if c.openErr != nil { |
| + return -1, c.openErr |
| + } |
| + f, err := os.Open(os.DevNull) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + opened, _ = unix.Dup(int(f.Fd())) |
| + f.Close() |
| + return opened, nil |
| + } |
| + readParent = func(int) (int, error) { return c.parent, c.parentErr } |
| + p := pid |
| + if c.pid != 0 { |
| + p = c.pid |
| + } |
| + fd, state := identify(p, monitor) |
| + if state != c.want { |
| + t.Errorf("%s: state %d, want %d", name, state, c.want) |
| + } |
| + switch { |
| + case state == initHeld && fd != opened: |
| + t.Errorf("%s: fd %d, want %d", name, fd, opened) |
| + case state != initHeld && fd != -1: |
| + t.Errorf("%s: fd %d", name, fd) |
| + case state != initHeld && opened >= 0: |
| + if _, err := unix.FcntlInt(uintptr(opened), unix.F_GETFD, 0); err == nil { |
| + t.Errorf("%s: the pidfd was left open", name) |
| + unix.Close(opened) |
| + } |
| + } |
| + if state == initHeld { |
| + unix.Close(fd) |
| + } |
| + } |
| +} |
| + |
| +// failClosed launches a real sandbox with a fault injected and checks |
| +// Launch fails with ErrNotEnded and returns no sandbox; whatever ran is |
| +// killed at the end of the test. |
| +func failClosed(t *testing.T) { |
| + t.Helper() |
| + cfg := testConfig(t, true) |
| + var inside []int |
| + testBeforeIdentity = func(monitor int) { inside = descendants(monitor) } |
| + defer func() { testBeforeIdentity = nil }() |
| + t.Cleanup(func() { |
| + for _, n := range inside { |
| + unix.Kill(n, unix.SIGKILL) |
| + } |
| + }) |
| + s, err := Launch(context.Background(), cfg) |
| + if s != nil || !errors.Is(err, ErrNotEnded) { |
| + if s != nil { |
| + s.Close() |
| + } |
| + t.Fatalf("Launch: %v, want ErrNotEnded", err) |
| + } |
| +} |
| + |
| +// Without a pidfd on the init (descriptors exhausted) the end of the |
| +// sandbox cannot be shown: Launch fails closed. |
| +func TestLaunchFailsClosedWithoutAPidfd(t *testing.T) { |
| + pidfdOpen = func(int, int) (int, error) { return -1, unix.EMFILE } |
| + defer func() { pidfdOpen = unix.PidfdOpen }() |
| + failClosed(t) |
| +} |
| + |
| +// Without the init's parent the pidfd may be anyone's: fail closed. |
| +func TestLaunchFailsClosedWhenTheParentIsUnreadable(t *testing.T) { |
| + readParent = func(int) (int, error) { return 0, unix.EIO } |
| + defer func() { readParent = parentOf }() |
| + failClosed(t) |
| +} |
| + |
| +// bubblewrap's monitor exits before the init is identified: the init, |
| +// moved to another parent, cannot be told from a process that took its |
| +// PID. The kernel's answers are fixed here (a pidfd, parent 1), so the |
| +// case runs every time; really, the init may also be gone already. |
| +func TestLaunchFailsClosedWhenTheMonitorLeftFirst(t *testing.T) { |
| + cfg := testConfig(t, true) |
| + var inside []int |
| + testBeforeIdentity = func(monitor int) { |
| + inside = descendants(monitor) |
| + killAndAwaitZombie(t, monitor) |
| + } |
| + readParent = func(int) (int, error) { return 1, nil } |
| + pidfdOpen = func(int, int) (int, error) { return unix.PidfdOpen(os.Getpid(), 0) } |
| + defer func() { testBeforeIdentity, readParent, pidfdOpen = nil, parentOf, unix.PidfdOpen }() |
| + t.Cleanup(func() { |
| + for _, n := range inside { |
| + unix.Kill(n, unix.SIGKILL) |
| + } |
| + }) |
| + s, err := Launch(context.Background(), cfg) |
| + if s != nil || !errors.Is(err, ErrNotEnded) { |
| + t.Fatalf("Launch: %v, want ErrNotEnded", err) |
| + } |
| +} |
| + |
| +// The same with the kernel's real answer, which depends on timing: the |
| +// init may still run (moved to another parent) or be gone. Either way |
| +// Launch never returns a sandbox, and unless it says ErrNotEnded nothing |
| +// of the sandbox runs when it returns. |
| +func TestLaunchNeverClaimsAnUnprovenEnd(t *testing.T) { |
| + for round := 0; round < 5; round++ { |
| + cfg := testConfig(t, true) |
| + var inside []int |
| + testBeforeIdentity = func(monitor int) { |
| + inside = descendants(monitor) |
| + killAndAwaitZombie(t, monitor) |
| + } |
| + s, err := Launch(context.Background(), cfg) |
| + testBeforeIdentity = nil |
| + if s != nil || err == nil { |
| + t.Fatalf("Launch: %v", err) |
| + } |
| + if !errors.Is(err, ErrNotEnded) { |
| + for _, n := range inside { |
| + if alive(n) { |
| + t.Fatalf("no ErrNotEnded, but process %d runs: %v", n, err) |
| + } |
| + } |
| + } |
| + for _, n := range inside { |
| + unix.Kill(n, unix.SIGKILL) |
| + } |
| + } |
| +} |
| + |
| +// killAndAwaitZombie kills this process's child pid and waits until it |
| +// has exited (a zombie, not yet reaped). |
| +func killAndAwaitZombie(t *testing.T, pid int) { |
| + t.Helper() |
| + unix.Kill(pid, unix.SIGKILL) |
| + for i := 0; i < 500; i++ { |
| + raw, err := os.ReadFile(filepath.Join("/proc", strconv.Itoa(pid), "stat")) |
| + if j := strings.LastIndexByte(string(raw), ')'); err == nil && j > 0 && j+2 < len(raw) && raw[j+2] == 'Z' { |
| + return |
| + } |
| + time.Sleep(10 * time.Millisecond) |
| + } |
| + t.Fatalf("bubblewrap %d did not exit", pid) |
| +} |
| + |
| +// A request already cancelled starts nothing, before even the tree is |
| +// read. |
| +func TestLaunchAlreadyCancelled(t *testing.T) { |
| + cfg := testConfig(t, true) |
| + forked := false |
| + testBeforeFork = func() { forked = true } |
| + defer func() { testBeforeFork = nil }() |
| + ctx, cancel := context.WithCancel(context.Background()) |
| + cancel() |
| + s, err := Launch(ctx, cfg) |
| + if s != nil || !errors.Is(err, context.Canceled) || errors.Is(err, ErrNotEnded) || forked { |
| + t.Fatalf("Launch: %v (forked %v)", err, forked) |
| + } |
| +} |
| + |
| +// stallingBwrap is a bubblewrap that starts and never writes its info. |
| +func stallingBwrap(t *testing.T, cfg *LaunchConfig) (started string) { |
| + t.Helper() |
| + _, self := usableBwrap(t) |
| + dir := tempDir(t) |
| + must(t, os.Symlink(self, filepath.Join(dir, "fake-bwrap-stall"))) |
| + cfg.Bwrap = filepath.Join(dir, "fake-bwrap-stall") |
| + return filepath.Join(dir, "started") |
| +} |
| + |
| +// Cancelled just before the fork: nothing starts. |
| +func TestLaunchCancelledAtFork(t *testing.T) { |
| + cfg := testConfig(t, true) |
| + started := stallingBwrap(t, &cfg) |
| + ctx, cancel := context.WithCancel(context.Background()) |
| + testBeforeFork = cancel |
| + defer func() { testBeforeFork = nil }() |
| + s, err := Launch(ctx, cfg) |
| + if s != nil || !errors.Is(err, context.Canceled) || errors.Is(err, ErrNotEnded) { |
| + t.Fatalf("Launch: %v", err) |
| + } |
| + time.Sleep(200 * time.Millisecond) |
| + if _, err = os.Stat(started); err == nil { |
| + t.Fatal("bubblewrap started") |
| + } |
| +} |
| + |
| +// awaitStarted waits for the stalling bubblewrap to say it runs and |
| +// returns its PID. |
| +func awaitStarted(t *testing.T, started string) int { |
| + t.Helper() |
| + for i := 0; i < 1000; i++ { |
| + if raw, err := os.ReadFile(started); err == nil && len(raw) > 0 { |
| + pid, err := strconv.Atoi(string(raw)) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + return pid |
| + } |
| + time.Sleep(10 * time.Millisecond) |
| + } |
| + t.Fatal("bubblewrap did not start") |
| + return 0 |
| +} |
| + |
| +// Cancelled while bubblewrap has not said which process is the init: |
| +// Launch returns at once, having killed bubblewrap, and says the end |
| +// could not be shown. |
| +func TestLaunchCancelledWhileAwaitingInfo(t *testing.T) { |
| + cfg := testConfig(t, true) |
| + started := stallingBwrap(t, &cfg) |
| + ctx, cancel := context.WithCancel(context.Background()) |
| + defer cancel() |
| + var pid int |
| + go func() { |
| + pid = awaitStarted(t, started) |
| + cancel() |
| + }() |
| + begun := time.Now() |
| + s, err := Launch(ctx, cfg) |
| + if s != nil || !errors.Is(err, context.Canceled) || !errors.Is(err, ErrNotEnded) { |
| + t.Fatalf("Launch: %v", err) |
| + } |
| + if took := time.Since(begun); took > 3*time.Second { |
| + t.Fatalf("Launch took %v after the cancel", took) |
| + } |
| + if alive(pid) { |
| + t.Fatalf("bubblewrap %d still runs", pid) |
| + } |
| +} |
| + |
| +// The same when the start timeout passes instead. |
| +func TestLaunchTimesOutAwaitingInfo(t *testing.T) { |
| + cfg := testConfig(t, true) |
| + started := stallingBwrap(t, &cfg) |
| + cfg.StartTimeout = 300 * time.Millisecond |
| + s, err := Launch(context.Background(), cfg) |
| + if s != nil || !errors.Is(err, os.ErrDeadlineExceeded) || !errors.Is(err, ErrNotEnded) { |
| + t.Fatalf("Launch: %v", err) |
| + } |
| + if pid := awaitStarted(t, started); alive(pid) { |
| + t.Fatalf("bubblewrap %d still runs", pid) |
| + } |
| +} |
| + |
| +// Cancelled once the init can be held: it is killed and shown to have |
| +// ended, so Launch reports the cancel and not ErrNotEnded, returns no |
| +// sandbox even when its ready came first, and nothing of the sandbox runs |
| +// when it returns. Ten rounds: which of ready and the cancel Launch sees |
| +// first is up to the scheduler. |
| +func TestLaunchCancelledOnceTheInitIsHeld(t *testing.T) { |
| + for round := 0; round < 10; round++ { |
| + cancelOnceHeld(t) |
| + } |
| +} |
| + |
| +func cancelOnceHeld(t *testing.T) { |
| + t.Helper() |
| + cfg := testConfig(t, true) |
| + ctx, cancel := context.WithCancel(context.Background()) |
| + defer cancel() |
| + var inside []int |
| + testBeforeIdentity = func(monitor int) { |
| + inside = descendants(monitor) |
| + cancel() |
| + } |
| + defer func() { testBeforeIdentity = nil }() |
| + t.Cleanup(func() { |
| + for _, n := range inside { |
| + unix.Kill(n, unix.SIGKILL) |
| + } |
| + }) |
| + s, err := Launch(ctx, cfg) |
| + if s != nil || !errors.Is(err, context.Canceled) || errors.Is(err, ErrNotEnded) { |
| + if s != nil { |
| + s.Close() |
| + } |
| + t.Fatalf("Launch: %v", err) |
| + } |
| + if len(inside) == 0 { |
| + t.Fatal("no process was seen in the sandbox") |
| + } |
| + for _, n := range inside { |
| + if alive(n) { |
| + t.Fatalf("process %d runs after Launch returned", n) |
| + } |
| + } |
| +} |
| + |
| +// A sandbox outlives no cancel: once ctx is done its init is killed, and |
| +// Wait returns with every process ended. |
| +func TestContextEndsTheSandbox(t *testing.T) { |
| + cfg := testConfig(t, true) |
| + ctx, cancel := context.WithCancel(context.Background()) |
| + defer cancel() |
| + s, err := Launch(ctx, cfg) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + defer s.Close() |
| + s.ToBrowser.WriteString("hang\x00") |
| + if reply, err := bufio.NewReader(s.FromBrowser).ReadString(0); err != nil || reply != "hanging\x00" { |
| + t.Fatalf("hang: %q %v", reply, err) |
| + } |
| + inside := descendants(s.cmd.Process.Pid) |
| + t.Cleanup(func() { |
| + for _, n := range inside { |
| + unix.Kill(n, unix.SIGKILL) |
| + } |
| + }) |
| + cancel() |
| + done := make(chan error, 1) |
| + go func() { _, err := s.Wait(); done <- err }() |
| + select { |
| + case err = <-done: |
| + case <-time.After(5 * time.Second): |
| + t.Fatal("the sandbox outlived its context") |
| + } |
| + if errors.Is(err, ErrNotEnded) { |
| + t.Fatalf("Wait: %v", err) |
| + } |
| + for _, n := range inside { |
| + if alive(n) { |
| + t.Fatalf("process %d runs after Wait", n) |
| + } |
| + } |
| +} |
diff --git a/internal/runner/render/render.go b/internal/runner/render/render.go| index 5dccb85a..1197c5c2 100644 |
| --- a/internal/runner/render/render.go |
| +++ b/internal/runner/render/render.go |
| @@ -122,11 +122,11 @@ type Sandbox struct { |
| cmd *exec.Cmd |
| mu sync.Mutex |
| - // pidfd is the sandbox's PID namespace init, or -1; noInit is an init |
| - // that may exist but could not be watched. |
| - pidfd int |
| - noInit bool |
| - exit BrowserExit |
| + // pidfd is the sandbox's PID namespace init while state is |
| + // initHeld, or -1. |
| + pidfd int |
| + state initState |
| + exit BrowserExit |
| // err is bubblewrap's; ended is ErrNotEnded or nil. |
| err error |
| ended error |
| @@ -203,3 +203,16 @@ func (b *bounded) Bytes() []byte { |
| defer b.mu.Unlock() |
| return bytes.Clone(b.buf.Bytes()) |
| } |
| + |
| +// What is known of a sandbox's PID namespace init. |
| +type initState int |
| + |
| +const ( |
| + // initUnknown: not identified; nothing shows the sandbox ended. |
| + initUnknown initState = iota |
| + // initHeld: the Sandbox's pidfd is the init. |
| + initHeld |
| + // initGone: the init had ended (so had its whole namespace) before |
| + // it could be held. |
| + initGone |
| +) |