hostedctl: tighten the simulation's invariants and crash points
I4 follows ruling R24 for every live VM tied to a recorded attempt, with three more extensions the unmutated runs needed (flagged for a ruling). I5 checks the stored pause fields and the request history; I7 ties running evidence to the pending operation. Skip-ahead never crosses a fault window. Six directed scenarios cover lost replies followed by a crash, and the thin mutation margins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 files changed,
+563
−101
docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md+54 −0internal/hostedctl/sim_model_test.go+202 −43internal/hostedctl/sim_test.go+307 −58
CI cancelled — superseded by a newer push — 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/hosted-runners-1a: Type Size Avail | ext4 96G 85G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type Size Avail | ext4 96G 85G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 1.3s
ci-box: codex: fetched and verified in 3.5s
ci-box: codex-code-mode-host: fetched and verified in 1.4s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.4s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 9.9s
ci-box: pi: installed and verified in 7.2s
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 9.3s
ci-box: clone deepened in 3.4s
ci-box: file times set from content: 2893 files, 193 directories
ci-box: ready in 16.5s
=== 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.243s
=== compile ===
go build ./...
go: downloading github.com/aws/aws-sdk-go-v2/config v1.33.21
go: downloading github.com/aws/aws-sdk-go-v2/credentials v1.21.3
go: downloading github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.9
go: downloading github.com/aws/aws-sdk-go-v2/service/sso v1.39.5
go: downloading github.com/aws/aws-sdk-go-v2/service/sts v1.53.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ssooidc v1.44.5
go: downloading github.com/aws/aws-sdk-go-v2/service/signin v1.14.0
go: downloading github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.12
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
1.2s
+ go list -export -test -tags testbuild -f ./...
1.3s
+ go list -export -test -tags browser,testbuild -f ./internal/equipo ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
0.3s
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-11 02:51:11 +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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
--- FAIL amadan.net/oficina/equipo/internal/headless TestHeadless
=== RUN TestHeadless
--- FAIL: TestHeadless (72.21s)
--- FAIL amadan.net/oficina/equipo/internal/headless TestHeadless/4c_rebase
=== RUN TestHeadless/4c_rebase
time=2026-11-22T19:51:31.644Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T19:51:31.644Z level=INFO msg="startup phase done" phase=state_lock took=79µs
time=2026-11-22T19:51:31.644Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T19:51:31.644Z level=INFO msg="startup phase done" phase=claim_roots took=86µs
time=2026-11-22T19:51:31.644Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T19:51:31.670Z level=INFO msg="startup phase done" phase=sweep took=26.679ms
time=2026-11-22T19:51:31.670Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T19:51:31.671Z level=INFO msg="startup phase done" phase=credentials took=101µs
time=2026-11-22T19:51:31.671Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T19:51:31.717Z level=INFO msg="startup phase done" phase=open_state took=46.628ms
time=2026-11-22T19:51:31.718Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T19:51:31.719Z level=INFO msg=connecting host=127.0.0.1:37665 protocol=28
time=2026-11-22T19:51:31.720Z level=INFO msg=connected host=127.0.0.1:37665 took=923µs
time=2026-11-22T19:51:31.720Z level=INFO msg="capabilities gathering"
time=2026-11-22T19:51:31.720Z level=INFO msg="capabilities gathered" took=441µs tags=linux,claude,go
time=2026-11-22T19:51:31.721Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T19:51:31.725Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-22T19:51:32.664Z level=INFO msg="connection checked" connection=claude-1 state=healthy
time=2026-11-22T19:51:36.927Z level=INFO msg="kept sessions" kept=1 bytes=2824 expired=0
time=2026-11-22T19:51:42.604Z level=INFO msg="kept sessions" kept=2 bytes=5030 expired=0
merge_test.go:245: steps [engineering:done checks:passed review:approve merge:merge_conflict engineering:queued], want [engineering:done checks:passed review:approve merge:merge_conflict engineering:done checks:passed review:approve merge:done] (in_progress )
time=2026-11-22T19:51:42.685Z level=WARN msg="step sweep" err=cancelled
time=2026-11-22T19:51:42.685Z level=WARN msg="kept sessions" err=cancelled
--- FAIL: TestHeadless/4c_rebase (11.44s)
--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m12.207s
FAIL amadan.net/oficina/equipo/internal/headless 72.583s
receipt: test step 1m13.817s 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 1m12.207s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m12.21s amadan.net/oficina/equipo/internal/headless TestHeadless
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -run '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$' -v -run '^TestHeadless$/^4c_rebase$' -count=1 ./internal/headless (retry, once)
##############################################################################
FLAKE ./internal/headless:TestHeadless/4c_rebase headless-work bf8d7443279ecf6e71bd7f4cfcaf433870f5c966 11.44s 39.21
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 34.50, cpu waiting 18.79%, memory waiting 0.00%, io waiting 0.44%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m23.269s 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 1m21.474s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m21.47s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 38.58, cpu waiting 21.97%, memory waiting 0.00%, io waiting 0.54%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m24.726s 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 1m22.613s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m11.96s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.92s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.73s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 38.58, cpu waiting 21.54%, memory waiting 0.00%, io waiting 0.53%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m20.25s 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.578s amadan.net/oficina/equipo/internal/headless
receipt: slow test 37.96s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 20.49s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 10.59s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 9.54s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 38.58, cpu waiting 22.24%, memory waiting 0.00%, io waiting 0.56%
--- 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_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m37.961s 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 1m36.202s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m0.23s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 11.23s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 10.06s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 8.84s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 5.85s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 32.94, cpu waiting 17.64%, memory waiting 0.00%, io waiting 0.41%
--- 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_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 3m10.084s 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 3m8.042s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m46.3s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 24.17s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 11.57s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 8.12s amadan.net/oficina/equipo/internal/headless TestHeadlessClaudeSignIn
receipt: slow test 7.34s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 8.84, cpu waiting 3.83%, 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 1.115s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 2m1.624s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 7.84s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.74s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 4.31s amadan.net/oficina/equipo/internal/thintest TestContractTeamUpdatePersonNeeds
receipt: slow test 3.81s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 3.52s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
machine: 32 CPUs, load 6.96, cpu waiting 1.36%, memory waiting 0.00%, io waiting 2.09%
--- 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 1.096s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1m26.784s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.08s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 5.03s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.41s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 2.4s amadan.net/oficina/equipo/internal/thintest TestContractPreview
receipt: slow test 2.34s amadan.net/oficina/equipo/internal/thintest TestContractPublishNameTaken
machine: 32 CPUs, load 6.96, cpu waiting 0.09%, memory waiting 0.00%, io waiting 2.13%
--- 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
cache miss: amadan.net/oficina/equipo/internal/runner/thin: its inputs changed
amadan: job cancelled — a newer push superseded it
--- 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
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed
receipt: test step 46.971s 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 45.755s amadan.net/oficina/equipo/internal/runner
receipt: slow test 25.73s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.02s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 38.73, cpu waiting 21.11%, memory waiting 0.00%, io waiting 1.00%
--- 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
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed
receipt: test step 47.386s 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 45.498s amadan.net/oficina/equipo/internal/runner
receipt: slow test 35.48s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 31.1s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.39s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.62s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 38.73, cpu waiting 21.57%, memory waiting 0.00%, io waiting 0.97%
--- 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
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed
receipt: test step 35.056s 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 34.231s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.12s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.34s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.12s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.23s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestReportPostsRetryExactRequest
machine: 32 CPUs, load 27.91, cpu waiting 14.07%, memory waiting 0.00%, io waiting 1.22%
--- 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 27.0%, load 24.42
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
cache miss: amadan.net/oficina/equipo/internal/equipotest: its inputs changed
receipt: test step 1m4.033s 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 1m2.113s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 26.2s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 26.18s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 24.16s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 21.75s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 21.45s amadan.net/oficina/equipo/internal/equipotest TestAuthorityProjectOwnershipIsLocal
machine: 32 CPUs, load 34.50, cpu waiting 18.79%, memory waiting 0.00%, io waiting 0.44%
--- 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 27.0%, load 24.42
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 1.202s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1m12.399s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 19.2s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 19.12s amadan.net/oficina/equipo/internal/equipotest TestProjectOwnersAreMembers
receipt: slow test 19.11s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 19.11s amadan.net/oficina/equipo/internal/equipotest TestProjectRetryAndRevision
receipt: slow test 19.08s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
machine: 32 CPUs, load 27.91, cpu waiting 12.45%, memory waiting 0.00%, io waiting 1.26%
--- 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 27.0%, load 24.42
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
cache miss: amadan.net/oficina/equipo/internal/equipotest: its inputs changed
receipt: test step 1m15.727s 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 1m3.646s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 14.16s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.11s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.1s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 10.06s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 7s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 28.94, cpu waiting 15.47%, memory waiting 0.00%, io waiting 0.36%
--- 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 27.0%, load 24.42
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 463ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1m4.231s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 24.45s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 23.28s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 23.2s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 21.61s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsUpgrade
receipt: slow test 21.57s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsRollbackAndUnavailable
machine: 32 CPUs, load 27.91, cpu waiting 11.14%, memory waiting 0.00%, io waiting 1.31%
--- 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 27.0%, load 24.42
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 560ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 48.756s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.61s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.41s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.5s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.47s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.21s amadan.net/oficina/equipo/internal/plan3test TestPlanMigrationUpgrade
machine: 32 CPUs, load 27.91, cpu waiting 11.14%, memory waiting 0.00%, io waiting 1.31%
--- 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 27.0%, load 24.42
test lane rest: ./cmd/equipo ./cmd/equipo-hosted-controller ./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/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./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/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/hostedctl ./internal/hostedwire ./internal/idtest ./internal/isolatedjob ./internal/isolatedjob/awsjob ./internal/isolatedjob/guardfixture ./internal/isolatedjob/isolatedjobtest ./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/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./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/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-hosted-controller ./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/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./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/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/hostedctl ./internal/hostedwire ./internal/idtest ./internal/isolatedjob ./internal/isolatedjob/awsjob ./internal/isolatedjob/guardfixture ./internal/isolatedjob/isolatedjobtest ./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/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./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/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/isolatedjob: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/opencode: 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/equipo/team: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/codex: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/checks: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/containment: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/pi: its inputs changed
--- FAIL amadan.net/oficina/equipo/internal/hostedctl TestReapLoopRunsPassesUntilDone
=== RUN TestReapLoopRunsPassesUntilDone
=== PAUSE TestReapLoopRunsPassesUntilDone
=== CONT TestReapLoopRunsPassesUntilDone
reaper_test.go:639: read unmatched_vms = hostedctl: begin: SQL logic error: cannot start a transaction within a transaction (1)
--- FAIL: TestReapLoopRunsPassesUntilDone (0.13s)
--- FAIL amadan.net/oficina/equipo/internal/hostedctl (package output)
FAIL
rastrillo-budget/v1 ran 13.236s
FAIL amadan.net/oficina/equipo/internal/hostedctl 13.252s
budget note: internal/equipo took 45.275s, 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/chat took 12.529s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/idtest took 39.84s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/release took 34.981s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/runner/containment took 39.846s, over the 15s its record on line 40 allows; reported only, timing fails on CI
receipt: test step 2m16.921s against a 60s target (the gate's other steps are not in this figure)
receipt: 13 packages ran, 52 cached, 20 without tests, 1 failed
receipt: slow package 53.208s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 51.634s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 45.275s amadan.net/oficina/equipo/internal/equipo
receipt: slow package 39.846s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow package 39.84s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 21.72s amadan.net/oficina/equipo/internal/runner/provider/opencode TestOpenCodeAcceptanceHostileRepository
receipt: slow test 15.53s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringOfflineGo
receipt: slow test 11.94s amadan.net/oficina/equipo/internal/hostedctl TestLifecycleSimulation
receipt: slow test 10.89s amadan.net/oficina/equipo/internal/idtest TestIDCallbackGuardAndPendingNonce
receipt: slow test 10.82s amadan.net/oficina/equipo/internal/equipo TestAgentReadRechecksIdentity
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestReapLoopRunsPassesUntilDone$' -count=1 ./internal/hostedctl (retry, once)
##############################################################################
FLAKE ./internal/hostedctl:TestReapLoopRunsPassesUntilDone rest bf8d7443279ecf6e71bd7f4cfcaf433870f5c966 0.13s 11.95
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 11.95, cpu waiting 5.53%, memory waiting 0.00%, io waiting 0.12%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m22.62s 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 1m21.244s amadan.net/oficina/equipo/internal/headless
receipt: slow test 37.34s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 15.22s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.57s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.71s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 5.98s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 38.58, cpu waiting 21.54%, memory waiting 0.00%, io waiting 0.53%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m32.814s 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.137s amadan.net/oficina/equipo/internal/headless
receipt: slow test 26.14s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 22.82s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 14.02s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 10.29s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 8.08s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 34.50, cpu waiting 18.79%, memory waiting 0.00%, io waiting 0.44%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m40.285s 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 1m38.604s amadan.net/oficina/equipo/internal/headless
receipt: slow test 13.95s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.1s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 13.05s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 10.37s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 10.06s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsOpenCodeGoLimitRequired
machine: 32 CPUs, load 31.02, cpu waiting 17.06%, memory waiting 0.00%, io waiting 0.40%
--- 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|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|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
rastrillo: budget test: go test failed
exit status 1
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN TestBrowserCopyContinue
time=2026-11-22T19:51:08.336Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T19:51:08.336Z level=INFO msg="startup phase done" phase=state_lock took=208µs
time=2026-11-22T19:51:08.336Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T19:51:08.336Z level=INFO msg="startup phase done" phase=claim_roots took=114µs
time=2026-11-22T19:51:08.336Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T19:51:08.368Z level=INFO msg="startup phase done" phase=sweep took=31.737ms
time=2026-11-22T19:51:08.368Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T19:51:08.368Z level=INFO msg="startup phase done" phase=credentials took=180µs
time=2026-11-22T19:51:08.368Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T19:51:08.414Z level=INFO msg="startup phase done" phase=open_state took=45.585ms
time=2026-11-22T19:51:08.414Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T19:51:08.415Z level=INFO msg=connecting host=127.0.0.1:39743 protocol=28
time=2026-11-22T19:51:08.416Z level=INFO msg=connected host=127.0.0.1:39743 took=950µs
time=2026-11-22T19:51:08.417Z level=INFO msg="capabilities gathering"
time=2026-11-22T19:51:08.418Z level=INFO msg="capabilities gathered" took=886µs tags=linux,claude,go
time=2026-11-22T19:51:08.418Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T19:51:08.422Z level=INFO msg=welcome protocol=28 role=primary generation=1
browser_copy_test.go:93: continue did not reach Checks: 0 <nil>
--- FAIL: TestBrowserCopyContinue (1.83s)
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserEmptyExplore
=== RUN TestBrowserEmptyExplore
time=2026-11-22T19:51:39.714Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T19:51:39.714Z level=INFO msg="startup phase done" phase=state_lock took=68µs
time=2026-11-22T19:51:39.714Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T19:51:39.714Z level=INFO msg="startup phase done" phase=claim_roots took=93µs
time=2026-11-22T19:51:39.714Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T19:51:39.743Z level=INFO msg="startup phase done" phase=sweep took=28.749ms
time=2026-11-22T19:51:39.743Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T19:51:39.743Z level=INFO msg="startup phase done" phase=credentials took=113µs
time=2026-11-22T19:51:39.743Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T19:51:39.784Z level=INFO msg="startup phase done" phase=open_state took=40.691ms
time=2026-11-22T19:51:39.784Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T19:51:39.785Z level=INFO msg=connecting host=127.0.0.1:38767 protocol=28
time=2026-11-22T19:51:39.787Z level=INFO msg=connected host=127.0.0.1:38767 took=2.281ms
time=2026-11-22T19:51:39.787Z level=INFO msg="capabilities gathering"
time=2026-11-22T19:51:39.788Z level=INFO msg="capabilities gathered" took=535µs tags=linux,claude,go
time=2026-11-22T19:51:39.792Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T19:51:39.795Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-22T19:51:40.833Z level=INFO msg="connection checked" connection=claude-1 state=healthy
browser_receipts_test.go:169: waiting for [...document.querySelectorAll('[equipo-markdown]:not([data-stream-text])')].some(e=>e.textContent.includes("I'm your coordinator")): context deadline exceeded (last evaluation: <nil>)
--- FAIL: TestBrowserEmptyExplore (5.84s)
--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m27.287s
FAIL amadan.net/oficina/equipo/internal/headless 87.573s
receipt: test step 1m28.656s 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 1m27.287s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.25s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 11.23s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.52s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 10.45s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 7.99s amadan.net/oficina/equipo/internal/headless TestBrowserRefreshRace
+ go test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|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$' -v -run '^TestBrowserCopyContinue$|^TestBrowserEmptyExplore$' -count=1 ./internal/headless (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserCopyContinue browser-headless-rest bf8d7443279ecf6e71bd7f4cfcaf433870f5c966 1.83s 36.38
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
##############################################################################
FLAKE ./internal/headless:TestBrowserEmptyExplore browser-headless-rest bf8d7443279ecf6e71bd7f4cfcaf433870f5c966 5.84s 36.38
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 31.02, cpu waiting 17.06%, memory waiting 0.00%, io waiting 0.40%
--- 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)$' ./internal/equipo
receipt: test step 1.03s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 573ms amadan.net/oficina/equipo/internal/equipo
receipt: slow test 570ms amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewBlocksNavigation
browser lane browser-rest: ./internal/idtest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserOficinaIDDoor)$' ./internal/idtest
receipt: test step 793ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1.673s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 1.67s 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 214ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1.856s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 1.86s 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|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|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 1.047s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 3m20.199s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 17.52s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.35s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.02s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.55s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 7.93s amadan.net/oficina/equipo/internal/thintest TestBrowserInnerScreens
machine: 32 CPUs, load 6.96, cpu waiting 1.74%, memory waiting 0.00%, io waiting 2.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 (52s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 5.34s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.29s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 9.31s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 9.71s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 24.69s
+ 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 (63s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 13.09s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 14.06s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 20.58s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 13.34s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless (21s)
ok ./internal/headless TestMixedVersions 19.79s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks (1s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.77s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin (1s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.05s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 41.07, cpu waiting 22.81%, memory waiting 0.00%, io waiting 0.74%
--- 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 8.307s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 3 without tests, 0 failed
receipt: slow package 7.082s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 168ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 72ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 0s amadan.net/oficina/equipo/internal/runner/provider/gotoolchain
receipt: slow test 5.02s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.67s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 300ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 170ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 80ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxToolchain
CGO_ENABLED=0 EQUIPO_REQUIRE_USER_SESSION=1 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 3.17s 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.855s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 260ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 190ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 140ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReapsOrphans
machine: 32 CPUs, load 15.41, cpu waiting 4.73%, memory waiting 0.00%, io waiting 1.77%
--- 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 27.0%, load 24.42
shard 25: make runner-dead-references lanes-check build vet fmt-check budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2606 text files, 2854 matches, 0 failures
python3 scripts/ci-test.py check
lanes: 18 lanes and 5 browser lanes run every test once; 20-check@29
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o /dev/null ./cmd/equipo-runner
go vet ./...
go vet -tags testbuild ./internal/runner/thin ./internal/headless
GOOS=darwin GOARCH=arm64 go vet ./cmd/equipo-runner/... ./internal/runner/... ./internal/wire/... ./internal/release/...
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 95 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok amadan.net/oficina/equipo/internal/equipo 2.512s
machine: 32 CPUs, load 37.14, cpu waiting 20.34%, memory waiting 0.00%, io waiting 1.03%
--- 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 27.0%, load 24.42
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 27.91, cpu waiting 12.45%, memory waiting 0.00%, io waiting 1.26%
--- 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 27.0%, load 24.42
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 0 vulnerabilities in packages you import and 5
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 32.88, cpu waiting 16.95%, memory waiting 0.00%, io waiting 1.14%
--- 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 27.0%, load 24.42
shard 28: make gitleaks
[90m7:50PM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net
[90m7:51PM[0m [32mINF[0m [1m1130 commits scanned.[0m
[90m7:51PM[0m [32mINF[0m [1mscanned ~62063450 bytes (62.06 MB) in 14.1s[0m
[90m7:51PM[0m [32mINF[0m [1mno leaks found[0m
machine: 32 CPUs, load 37.14, cpu waiting 20.34%, memory waiting 0.00%, io waiting 1.03%
diff --git a/docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md b/docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md| index 9e5595de..5c9f1042 100644 |
| --- a/docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md |
| +++ b/docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md |
| @@ -674,6 +674,60 @@ failing of 200 in brackets. |
| | I7a raise the epoch before preparing (prepare UPDATE sets `epoch = epoch + 1`) | `seed 5 failed at step 21: I7: provider resume of vm-0001 for operation op-1 prepared at epoch 1 while the job's epoch is 1` (13) | yes, passes | |
| | I7b commit on a lost reply (driveResume commits on `ErrLostReply`) | `seed 25 failed at step 21: I7: a2 operation op-1 committed with no running read of vm-0002 after its last resume call` (6) | yes, passes | |
| +### Task 14 fix round 1 (review r1, ruling R24) |
| + |
| +1. I4 per R24: every live fake VM (stopping included) tied to a recorded attempt by saved Ref or |
| + spec attempt ID, bound max(stop_t, OpenedAt) + ReapInterval with R24's extensions (a) stopping |
| + after a Stop issued within the bound then in force, (b) the current run of throttled-Stop passes |
| + only, (c) OrphanGrace + ReapInterval for a VM with no saved Ref, exempt while R22 deferral |
| + applies (and one interval after). Three more extensions were needed for correct controller |
| + behaviour, each found by an unmutated failure and flagged for a ruling: (d) a VM with no saved |
| + Ref gets an interval per pass since it appeared in which a List failed (seeds 36, 43, 121: orphans |
| + first seen late behind incomplete Lists); (e) after a restart a pre-restart job gets an interval |
| + per pass since the open in which its Get failed, at most RestartGetTries (seed 969: R20 delays the |
| + re-base); (f) a VM claimed late is bounded no earlier than one interval after the Launch reply |
| + that first carried its Ref (seeds 1688, 4498: claimed by the orphan recheck's replay, after the |
| + deadline step). |
| +2. I7: running evidence is tied to the pending operation the latest provider Resume was for and is |
| + dropped by any other observed phase (a Get reading another state, a Suspend or Stop). A new |
| + mutation I7c (commit while preparing, no provider call) checks the reviewer's case. |
| +3. I5: at every provider Suspend the stored state, generation, `pause_quiescent`, |
| + `pause_cancelled` and `pause_started_t` are checked, a named generation must equal the stored |
| + one, and the simulation's drain and acknowledgement history must agree; that history is also |
| + checked against the store after every step and pass. |
| +4. Skip-ahead skips only with no failing-audit window, incomplete-List window or queued List fault |
| + left, so no omitted pass would have played a fault (no pass is counted twice any more). |
| +5. Six directed scenarios run first under the same invariants: lost launch, stop and resume |
| + replies, each confirming the provider effect and the unresolved store state, then Close, Open |
| + and New before any reconciliation; a resume throttled while the VM stays suspended (after a |
| + running read before the suspend); a waiting intent's VM past its orphan grace while audits fail; |
| + next-generation acknowledgement and suspend refused. A model bug found on the way: a repeated |
| + Resume of a done operation closed the model's newer pause (seed 250); fixed. |
| + |
| +- GREEN: `go test ./internal/hostedctl -run TestLifecycleSimulation -count=1` ok 2.74 to 2.84 s |
| + over five runs at load average 8; `EQUIPO_SIM_SEEDS=5000` ok 73.8 s; whole package (with Task |
| + 15) ok 6.66 to 7.29 s; 40 seeds under `-race` ok; vet, gofmt, staticcheck v0.7.0, `make budget`, |
| + dead-reference scan 0 failures. Test lines in the directory 7,703 of 8,000. |
| +- Mutations ran in a scratch copy (`git archive HEAD` plus the sim files), never in the worktree; |
| + the copy was removed. Command for every row as above. "Scenarios" names the directed scenarios |
| + that fail, which they do on every run. |
| + |
| +| Mutation | Observed failure | Seeds (of 200) | Scenarios | Restored | |
| +| --- | --- | --- | --- | --- | |
| +| I1 | `seed 1 failed at step 15: I1: attempt a2 has 2 live VMs: [vm-0003 vm-0004]` | 154 | lost launch; orphan recheck (I1) | yes, passes | |
| +| I2 | `seed 1 failed at step 38: I2: VM vm-0006 (attempt a4, starting) is no saved Ref, ...` | 169 | lost launch; orphan recheck (I2) | yes, passes | |
| +| I3a | `seed 1 failed at step 2: I3: orphan stop of vm-0001 at 9s, first seen at 9s: grace not over` | 102 | none | yes, passes | |
| +| I3b | `scenario a waiting intent's VM outlives its orphan grace failed at step 3: I3: orphan stop of vm-0001, the VM of waiting intent a1` | 6 | orphan recheck | yes, passes | |
| +| I4a | `seed 1 failed at step 18: I4: VM vm-0003 of a2 is running at 8m19s, its stop time 6m47s (bound 7m47s, ...)` | 138 | lost launch | yes, passes | |
| +| I4b | same line as I4a at seed 1 step 18 (wall net 10 min back) | 25 | none | yes, passes | |
| +| I4c | `seed 3 failed at step 14: I4: VM vm-0003 of a3 is running at 5m34s, its stop time 3m34s (bound 4m34s, ...)` | 24 | none | yes, passes | |
| +| I5 | `scenario future generations are refused failed at step 4: I5: a1 generation 1 is stored acknowledged; no acknowledgement of it came in time` | 28 | future generations | yes, passes | |
| +| I5 plain `>=` only | `scenario future generations are refused failed at step 4: scenario: acknowledge the next generation: unexpected result hostedctl: record quiescent for a1: 0 rows` (earlier guard; no invariant) | 0 | future generations | yes, passes | |
| +| I6 | `seed 4 failed at step 5: I6: a1 holds proof from state "unknown"` | 87 | none | yes, passes | |
| +| I7a | `scenario lost resume reply, crash, reconcile failed at step 7: I7: provider resume of vm-0001 for operation op-1 prepared at epoch 1 while the job's epoch is 1` | 13 | lost resume; throttled resume | yes, passes | |
| +| I7b | `scenario lost resume reply, crash, reconcile failed at step 7: I7: a1 operation op-1 committed with no running read of vm-0001 after a provider resume for it` | 6 | lost resume | yes, passes | |
| +| I7c commit while preparing (Resume calls `finishResume` as running, no provider call) | `scenario throttled resume while the VM stays suspended failed at step 7: I7: a1 operation op-1 committed with no running read of vm-0001 after a provider resume for it` | 13 | lost resume; throttled resume | yes, passes | |
| + |
| ## Task 15 |
| Controller HTTP API (`internal/hostedctl/http.go`), metrics (`metrics.go`) and the |
diff --git a/internal/hostedctl/sim_model_test.go b/internal/hostedctl/sim_model_test.go| index ef39e75d..66941687 100644 |
| --- a/internal/hostedctl/sim_model_test.go |
| +++ b/internal/hostedctl/sim_model_test.go |
| @@ -24,7 +24,9 @@ type simVM struct { |
| attempt string // the spec's attempt ID (the client token), or the planted name |
| launchID string // from the bootstrap; empty for a planted VM |
| planted bool |
| - created T // model controller time when the VM appeared |
| + claimed T // when a Launch reply first carried its Ref; 0 if none yet |
| + created T // model controller time when the VM appeared |
| + pass int // reaper passes begun when it appeared |
| } |
| // simGen names the Suspend call the simulation is making: its attempt and |
| @@ -50,15 +52,40 @@ type simRunner struct { |
| incomplete int // reaper passes left whose List calls all come back incomplete |
| listBad bool // the pass running now is one of them |
| vms map[isolatedjob.Ref]*simVM |
| - throttled map[isolatedjob.Ref]int // Stop calls the fake throttled, per VM |
| - sawRunning map[isolatedjob.Ref]bool // a Get read running since the last Resume call |
| suspendOp *simGen |
| bad []string // call-time violations, reported by the next check |
| + |
| + // For I4 (ruling R24): passes begun; per VM, the current unbroken run |
| + // of passes with a throttled Stop (reset by any Stop that is not |
| + // throttled) and the first Stop that took effect, or the provider's own |
| + // end, with the run credited when it was issued. |
| + passNo int |
| + listFail []int // passes in which a List failed, so orphans were not handled |
| + getFail map[isolatedjob.Ref][]int // passes in which a Get of the VM failed |
| + openPass int // passNo at the latest open |
| + stopRun map[isolatedjob.Ref]int |
| + runPass map[isolatedjob.Ref]int |
| + stoppedB map[isolatedjob.Ref]simStopAt |
| + |
| + // For I7: per VM, the pending operation its latest provider Resume was |
| + // for, and the operation whose resume a later Get saw running. Any |
| + // observed change of phase (a Get reading another state, a Suspend or a |
| + // Stop) drops the running evidence. |
| + resumeOp map[isolatedjob.Ref]string |
| + runningFor map[isolatedjob.Ref]string |
| +} |
| + |
| +// simStopAt is when a Stop for a VM first took effect, and the throttle |
| +// credit (in reaper intervals) its I4 bound had then. |
| +type simStopAt struct { |
| + at T |
| + credit int |
| } |
| func newSimRunner(fake *isolatedjob.Fake, w *simWorld) *simRunner { |
| return &simRunner{fake: fake, w: w, pending: map[isolatedjob.Op][]isolatedjob.Fault{}, |
| - vms: map[isolatedjob.Ref]*simVM{}, throttled: map[isolatedjob.Ref]int{}, sawRunning: map[isolatedjob.Ref]bool{}} |
| + vms: map[isolatedjob.Ref]*simVM{}, getFail: map[isolatedjob.Ref][]int{}, stopRun: map[isolatedjob.Ref]int{}, runPass: map[isolatedjob.Ref]int{}, |
| + stoppedB: map[isolatedjob.Ref]simStopAt{}, resumeOp: map[isolatedjob.Ref]string{}, runningFor: map[isolatedjob.Ref]string{}} |
| } |
| func (r *simRunner) queue(op isolatedjob.Op, f isolatedjob.Fault) { |
| @@ -109,9 +136,12 @@ func (r *simRunner) Launch(ctx context.Context, s isolatedjob.LaunchSpec) (isola |
| ref, err := r.fake.Launch(ctx, s) |
| for now := range r.visibleLocked() { |
| if !before[now] { |
| - r.vms[now] = &simVM{attempt: s.AttemptID, launchID: bootLaunchID(s.Bootstrap), created: r.w.now()} |
| + r.vms[now] = &simVM{attempt: s.AttemptID, launchID: bootLaunchID(s.Bootstrap), created: r.w.now(), pass: r.passNo} |
| } |
| } |
| + if v := r.vms[ref]; err == nil && v != nil && v.claimed == 0 { |
| + v.claimed = r.w.now() |
| + } |
| r.w.logf(" provider launch %s%s -> %s %s", s.AttemptID, faultNote(f), ref, errText(err)) |
| return ref, err |
| } |
| @@ -121,8 +151,15 @@ func (r *simRunner) Get(ctx context.Context, ref isolatedjob.Ref) (isolatedjob.J |
| defer r.mu.Unlock() |
| f := r.inject(isolatedjob.OpGet) |
| j, err := r.fake.Get(ctx, ref) |
| - if err == nil && j.State == isolatedjob.StateRunning { |
| - r.sawRunning[ref] = true |
| + switch { |
| + case err == nil && j.State == isolatedjob.StateRunning: |
| + if op := r.resumeOp[ref]; op != "" { |
| + r.runningFor[ref] = op |
| + } |
| + case err == nil || errors.Is(err, isolatedjob.ErrNotFound): |
| + delete(r.runningFor, ref) // another phase: earlier running evidence is stale |
| + case !slices.Contains(r.getFail[ref], r.passNo): |
| + r.getFail[ref] = append(r.getFail[ref], r.passNo) |
| } |
| if f != "" || err != nil { |
| r.w.logf(" provider get %s%s -> %s %s", ref, faultNote(f), j.State, errText(err)) |
| @@ -136,6 +173,7 @@ func (r *simRunner) Suspend(ctx context.Context, ref isolatedjob.Ref) error { |
| r.checkSuspendLocked(ref) |
| f := r.inject(isolatedjob.OpSuspend) |
| err := r.fake.Suspend(ctx, ref) |
| + r.phaseLocked(ref, err) |
| r.w.logf(" provider suspend %s%s -> %s", ref, faultNote(f), errText(err)) |
| return err |
| } |
| @@ -143,8 +181,8 @@ func (r *simRunner) Suspend(ctx context.Context, ref isolatedjob.Ref) error { |
| func (r *simRunner) Resume(ctx context.Context, ref isolatedjob.Ref) error { |
| r.mu.Lock() |
| defer r.mu.Unlock() |
| - r.checkResumeLocked(ref) |
| - r.sawRunning[ref] = false |
| + r.resumeOp[ref] = r.checkResumeLocked(ref) |
| + delete(r.runningFor, ref) |
| f := r.inject(isolatedjob.OpResume) |
| err := r.fake.Resume(ctx, ref) |
| r.w.logf(" provider resume %s%s -> %s", ref, faultNote(f), errText(err)) |
| @@ -159,8 +197,12 @@ func (r *simRunner) Stop(ctx context.Context, ref isolatedjob.Ref, reason string |
| } |
| f := r.inject(isolatedjob.OpStop) |
| err := r.fake.Stop(ctx, ref, reason) |
| - if errors.Is(err, isolatedjob.ErrThrottled) { |
| - r.throttled[ref]++ |
| + r.phaseLocked(ref, err) |
| + if !errors.Is(err, isolatedjob.ErrThrottled) { |
| + r.stoppedLocked(ref) |
| + } else if r.runPass[ref] != r.passNo || r.stopRun[ref] == 0 { |
| + r.stopRun[ref]++ |
| + r.runPass[ref] = r.passNo |
| } |
| r.w.logf(" provider stop %s (%s)%s -> %s", ref, reason, faultNote(f), errText(err)) |
| return err |
| @@ -171,6 +213,9 @@ func (r *simRunner) List(ctx context.Context) ([]isolatedjob.Job, error) { |
| defer r.mu.Unlock() |
| f := r.inject(isolatedjob.OpList) |
| vms, err := r.fake.List(ctx) |
| + if err != nil && !slices.Contains(r.listFail, r.passNo) { |
| + r.listFail = append(r.listFail, r.passNo) |
| + } |
| if f != "" { |
| r.w.logf(" provider list%s -> %d VMs %s", faultNote(f), len(vms), errText(err)) |
| } |
| @@ -179,6 +224,33 @@ func (r *simRunner) List(ctx context.Context) ([]isolatedjob.Job, error) { |
| func (r *simRunner) Limits() isolatedjob.Limits { return r.fake.Limits() } |
| +// phaseLocked drops a VM's running evidence after a Suspend or Stop that |
| +// was not throttled: its phase may have changed. |
| +func (r *simRunner) phaseLocked(ref isolatedjob.Ref, err error) { |
| + if !errors.Is(err, isolatedjob.ErrThrottled) { |
| + delete(r.runningFor, ref) |
| + } |
| +} |
| + |
| +// stoppedLocked records the first Stop of ref that took effect (or the |
| +// provider's own end) with the throttle credit in force, and ends the run |
| +// of throttled Stops. |
| +func (r *simRunner) stoppedLocked(ref isolatedjob.Ref) { |
| + if _, ok := r.stoppedB[ref]; !ok { |
| + r.stoppedB[ref] = simStopAt{at: r.w.now(), credit: r.stopRun[ref]} |
| + } |
| + r.stopRun[ref] = 0 |
| +} |
| + |
| +// end is the provider stopping a VM on its own, with no controller call. |
| +func (r *simRunner) end(ref isolatedjob.Ref) { |
| + r.mu.Lock() |
| + defer r.mu.Unlock() |
| + _ = r.fake.Stop(context.Background(), ref, "ended") |
| + delete(r.runningFor, ref) |
| + r.stoppedLocked(ref) |
| +} |
| + |
| // plant adds an orphan VM no Launch asked for. |
| func (r *simRunner) plant(name string) isolatedjob.Ref { |
| r.mu.Lock() |
| @@ -193,6 +265,7 @@ func (r *simRunner) plant(name string) isolatedjob.Ref { |
| func (r *simRunner) beginPass() { |
| r.mu.Lock() |
| defer r.mu.Unlock() |
| + r.passNo++ |
| r.listBad = r.incomplete > 0 |
| if r.listBad { |
| r.incomplete-- |
| @@ -231,9 +304,11 @@ func bootLaunchID(b []byte) string { |
| type simJob struct { |
| attempt, launchID, state, replaces string |
| ref isolatedjob.Ref // empty when none is saved |
| - stopT, drainT T |
| + launchedT, stopT, drainT T |
| epoch, gen int64 |
| - stopRequested bool |
| + pauseStarted sql.NullInt64 |
| + quiescent, cancelled bool |
| + stopRequested, dispatched bool |
| proof string // stop_proof_json; empty when none |
| } |
| @@ -267,15 +342,17 @@ func (w *simWorld) read() (*simSnap, error) { |
| unmatched: map[isolatedjob.Ref]T{}, vm: map[isolatedjob.Ref]isolatedjob.Job{}} |
| err := w.store.Tx(w.ctx, func(tx *sql.Tx) error { |
| rows, err := tx.QueryContext(w.ctx, `SELECT attempt_id, launch_id, state, coalesce(replaces_attempt, ''), |
| - coalesce(vm_ref, ''), stop_t, drain_t, epoch, pause_generation, stop_requested_t IS NOT NULL, |
| + coalesce(vm_ref, ''), launched_t, stop_t, drain_t, epoch, pause_generation, pause_started_t, pause_quiescent, |
| + pause_cancelled, stop_requested_t IS NOT NULL, last_dispatch_t IS NOT NULL, |
| coalesce(stop_proof_json, '') FROM jobs ORDER BY attempt_id`) |
| if err != nil { |
| return err |
| } |
| for rows.Next() { |
| j := &simJob{} |
| - if err := rows.Scan(&j.attempt, &j.launchID, &j.state, &j.replaces, &j.ref, &j.stopT, &j.drainT, |
| - &j.epoch, &j.gen, &j.stopRequested, &j.proof); err != nil { |
| + if err := rows.Scan(&j.attempt, &j.launchID, &j.state, &j.replaces, &j.ref, &j.launchedT, &j.stopT, &j.drainT, |
| + &j.epoch, &j.gen, &j.pauseStarted, &j.quiescent, &j.cancelled, &j.stopRequested, &j.dispatched, |
| + &j.proof); err != nil { |
| _ = rows.Close() |
| return err |
| } |
| @@ -404,10 +481,13 @@ func (r *simRunner) checkOrphanStopLocked(ref isolatedjob.Ref) { |
| } |
| } |
| -// checkSuspendLocked is I5, as the provider Suspend is sent: the model |
| -// holds an in-time acknowledgement for the job's current generation, its |
| -// pause still open. The generation is the one the simulation's Suspend call |
| -// named, or the stored one for a suspend Refresh sends again. |
| +// checkSuspendLocked is I5, as the provider Suspend is sent. The store |
| +// must hold the job suspending in its current generation, acknowledged |
| +// (pause_quiescent), not cancelled, its pause open; a Suspend call the |
| +// simulation made must have named that stored generation; and the |
| +// simulation's own history must agree: that generation is the last drain |
| +// it saw accepted, at the stored pause start, and it saw it acknowledged in |
| +// time. |
| func (r *simRunner) checkSuspendLocked(ref isolatedjob.Ref) { |
| s, err := r.w.read() |
| if err != nil { |
| @@ -419,13 +499,15 @@ func (r *simRunner) checkSuspendLocked(ref isolatedjob.Ref) { |
| r.violate("I5: provider suspend of %s, which no job holds", ref) |
| return |
| } |
| - gen := j.gen |
| - if r.suspendOp != nil && r.suspendOp.attempt == j.attempt { |
| - gen = r.suspendOp.gen |
| + if j.state != JobSuspending || !j.quiescent || j.cancelled || !j.pauseStarted.Valid { |
| + r.violate("I5: provider suspend of %s (%s): stored state %s, generation %d, quiescent %v, cancelled %v, pause started %v", |
| + ref, j.attempt, j.state, j.gen, j.quiescent, j.cancelled, j.pauseStarted) |
| } |
| - p := r.w.m.pause[j.attempt] |
| - if p == nil || !p.open || !p.acked || p.gen != gen { |
| - r.violate("I5: provider suspend of %s (%s) for generation %d; the model's pause is %+v", ref, j.attempt, gen, p) |
| + if op := r.suspendOp; op != nil && op.attempt == j.attempt && op.gen != j.gen { |
| + r.violate("I5: provider suspend of %s for named generation %d; the stored one is %d", ref, op.gen, j.gen) |
| + } |
| + if p := r.w.m.pause[j.attempt]; p == nil || !p.open || !p.acked || p.gen != j.gen || int64(p.drainedAt) != j.pauseStarted.Int64 { |
| + r.violate("I5: provider suspend of %s (%s) at stored generation %d; the simulation's history is %+v", ref, j.attempt, j.gen, p) |
| } |
| } |
| @@ -454,16 +536,17 @@ func (r *simRunner) checkReplacementLocked(spec isolatedjob.LaunchSpec) { |
| // checkResumeLocked is I7's call half: a provider Resume needs a pending |
| // operation prepared at one above the job's epoch, which is not yet raised. |
| -func (r *simRunner) checkResumeLocked(ref isolatedjob.Ref) { |
| +// It returns that operation's ID, the one later running evidence is for. |
| +func (r *simRunner) checkResumeLocked(ref isolatedjob.Ref) string { |
| s, err := r.w.read() |
| if err != nil { |
| r.violate("I7: %v", err) |
| - return |
| + return "" |
| } |
| j := s.byRef[ref] |
| if j == nil { |
| r.violate("I7: provider resume of %s, which no job holds", ref) |
| - return |
| + return "" |
| } |
| var pending []simResumeOp |
| for _, o := range s.ops { |
| @@ -478,6 +561,10 @@ func (r *simRunner) checkResumeLocked(ref isolatedjob.Ref) { |
| r.violate("I7: provider resume of %s for operation %s prepared at epoch %d while the job's epoch is %d", |
| ref, pending[0].id, pending[0].prepared, j.epoch) |
| } |
| + if len(pending) == 0 { |
| + return "" |
| + } |
| + return pending[0].id |
| } |
| // check runs every invariant on snapshot s and returns the violations, |
| @@ -531,20 +618,90 @@ func (w *simWorld) check(s *simSnap) []string { |
| } |
| } |
| - // I4: no recorded job's VM live past its stop time plus one reaper |
| - // interval (plus one per throttled stop call; a restart counts from |
| - // the open, as the first pass comes at most an interval later). |
| - for _, id := range s.order { |
| - j := s.jobs[id] |
| - vm, ok := s.vm[j.ref] |
| - if j.ref == "" || !ok || !vm.State.Live() || vm.State == isolatedjob.StateStopping { |
| + // I4, as ruling R24 words it: every live VM (stopping included) tied |
| + // to a recorded attempt, by a saved Ref or by the fake's spec attempt |
| + // ID, is live no later than max(stop_t, OpenedAt) + ReapInterval, plus |
| + // one interval per pass of its current run of throttled Stops; a |
| + // stopping VM also passes when its first effective Stop came within |
| + // the bound in force then; a VM with no saved Ref gets OrphanGrace + |
| + // ReapInterval more, and is exempt while R22 deferral applies (and for |
| + // one interval after, the reaper's next pass). Beyond R24, (d): a VM |
| + // with no saved Ref also gets one interval for each pass since it |
| + // appeared in which a List failed, as the reaper handles orphans only on |
| + // complete Lists. And (e), after R20: after a restart, a job launched |
| + // before the open gets one interval for each pass since the open in |
| + // which a Get of its VM failed (at most RestartGetTries), as its stop |
| + // time is re-based only on a Get that answers. And (f), carrying (c) |
| + // over: a VM claimed late (a replay's Launch reply first carried its |
| + // Ref, perhaps in the orphan recheck after the deadline step) is |
| + // bounded no earlier than one interval after that reply. |
| + deferral := false |
| + for _, j := range s.jobs { |
| + deferral = deferral || (j.state == JobWaiting && j.ref == "" && j.dispatched) |
| + } |
| + for _, vm := range s.vms { |
| + j, v := s.byRef[vm.Ref], r.vms[vm.Ref] |
| + noRef := j == nil |
| + if noRef && v != nil { |
| + j = s.jobs[v.attempt] |
| + } |
| + if j == nil || !vm.State.Live() { |
| + continue |
| + } |
| + if noRef && deferral { |
| + w.m.deferredAt[vm.Ref] = now |
| continue |
| } |
| - stop := min(j.stopT, w.m.stopAt[id]) |
| - allow := T(ReapInterval) * T(1+r.throttled[j.ref]) |
| - if from := max(stop, w.openedAt); now > from+allow { |
| - add("I4: VM %s of %s is %s at %v, its stop time %v (allowed until %v)", j.ref, id, vm.State, |
| - simDur(now), simDur(stop), simDur(from+allow)) |
| + base := max(min(j.stopT, w.m.stopAt[j.attempt]), w.store.OpenedAt()) + T(ReapInterval) |
| + if noRef { |
| + base += T(OrphanGrace + ReapInterval) |
| + for _, p := range r.listFail { |
| + if v != nil && p >= v.pass { |
| + base += T(ReapInterval) |
| + } |
| + } |
| + } |
| + if w.store.Restarted() && j.launchedT <= w.store.OpenedAt() { |
| + n := 0 |
| + for _, p := range r.getFail[vm.Ref] { |
| + if p > r.openPass { |
| + n++ |
| + } |
| + } |
| + base += T(ReapInterval) * T(min(n, RestartGetTries)) |
| + } |
| + if v != nil && v.claimed > 0 { |
| + base = max(base, v.claimed+T(ReapInterval)) |
| + } |
| + if at, ok := w.m.deferredAt[vm.Ref]; ok { |
| + base = max(base, at+T(ReapInterval)) |
| + } |
| + if now <= base+T(ReapInterval)*T(r.stopRun[vm.Ref]) { |
| + continue |
| + } |
| + if st, ok := r.stoppedB[vm.Ref]; ok && vm.State == isolatedjob.StateStopping && st.at <= base+T(ReapInterval)*T(st.credit) { |
| + continue |
| + } |
| + add("I4: VM %s of %s is %s at %v, its stop time %v (bound %v, throttle run %d, saved Ref %v)", vm.Ref, j.attempt, |
| + vm.State, simDur(now), simDur(j.stopT), simDur(base), r.stopRun[vm.Ref], !noRef) |
| + } |
| + |
| + // I5, the store against the simulation's history: a job's stored |
| + // generation is the last drain the simulation saw accepted, started |
| + // when it drained, and is acknowledged only if the simulation saw an |
| + // acknowledgement of it in time. |
| + for _, id := range s.order { |
| + j, p := s.jobs[id], w.m.pause[id] |
| + switch { |
| + case p == nil && j.gen != 0: |
| + add("I5: %s holds generation %d with no drain accepted", id, j.gen) |
| + case p == nil: |
| + case j.gen != p.gen: |
| + add("I5: %s holds generation %d; the last drain accepted gave %d", id, j.gen, p.gen) |
| + case j.pauseStarted.Valid && j.pauseStarted.Int64 != int64(p.drainedAt): |
| + add("I5: %s pause started at %v; generation %d drained at %v", id, simDur(T(j.pauseStarted.Int64)), p.gen, simDur(p.drainedAt)) |
| + case j.quiescent && !p.acked: |
| + add("I5: %s generation %d is stored acknowledged; no acknowledgement of it came in time", id, j.gen) |
| } |
| } |
| @@ -596,9 +753,11 @@ func (w *simWorld) check(s *simSnap) []string { |
| seen[o.prepared] = true |
| key := [2]string{id, o.id} |
| if _, known := w.m.done[key]; !known { |
| - if !r.sawRunning[j.ref] { |
| - add("I7: %s operation %s committed with no running read of %s after its last resume call", id, o.id, j.ref) |
| + if r.runningFor[j.ref] != o.id { |
| + add("I7: %s operation %s committed with no running read of %s after a provider resume for it (evidence for %q)", |
| + id, o.id, j.ref, r.runningFor[j.ref]) |
| } |
| + delete(r.runningFor, j.ref) |
| w.m.done[key] = o.result.Int64 |
| w.closePause(id) |
| } |
diff --git a/internal/hostedctl/sim_test.go b/internal/hostedctl/sim_test.go| index 5098fc8f..6e95e033 100644 |
| --- a/internal/hostedctl/sim_test.go |
| +++ b/internal/hostedctl/sim_test.go |
| @@ -3,6 +3,7 @@ package hostedctl |
| import ( |
| "context" |
| "database/sql" |
| + "errors" |
| "fmt" |
| "math/rand" |
| "os" |
| @@ -25,7 +26,9 @@ import ( |
| // and the fake provider, through random launches, crashes, provider faults, |
| // pauses, resumes, orphans, stops, wall-clock jumps and time advances, and |
| // checks the invariants of spec §14 (I1 to I7, sim_model_test.go) after |
| -// every step and every reaper pass. Each seed fixes the random choices; |
| +// every step and every reaper pass. The directed scenarios (simScenarios) |
| +// run first. Each seed fixes the random choices, though not the order in |
| +// which the two goroutines of a concurrent duplicate launch run; |
| // EQUIPO_SIM_SEEDS=n runs seeds 1 to n (default 200) and EQUIPO_SIM_SEED=s |
| // runs seed s alone. A failure prints its seed and step log. |
| func TestLifecycleSimulation(t *testing.T) { |
| @@ -51,6 +54,11 @@ func TestLifecycleSimulation(t *testing.T) { |
| template := simTemplate(t, dir) |
| var mu sync.Mutex |
| var fails []*simFailure |
| + for i, sc := range simScenarios { |
| + if f := runSim(dir, -int64(i+1), template, sc.name, sc.run); f != nil { |
| + fails = append(fails, f) |
| + } |
| + } |
| next := make(chan int64) |
| var wg sync.WaitGroup |
| for range min(runtime.GOMAXPROCS(0), 8, len(seeds)) { |
| @@ -58,7 +66,7 @@ func TestLifecycleSimulation(t *testing.T) { |
| go func() { |
| defer wg.Done() |
| for seed := range next { |
| - if f := runSimSeed(dir, seed, template); f != nil { |
| + if f := runSim(dir, seed, template, "", (*simWorld).randomSteps); f != nil { |
| mu.Lock() |
| fails = append(fails, f) |
| mu.Unlock() |
| @@ -79,14 +87,22 @@ func TestLifecycleSimulation(t *testing.T) { |
| wg.Wait() |
| slices.SortFunc(fails, func(a, b *simFailure) int { return int(a.seed - b.seed) }) |
| for _, f := range fails { |
| - t.Errorf("seed %d failed at step %d:\n %s", f.seed, f.step, strings.Join(f.bad, "\n ")) |
| + what := fmt.Sprintf("seed %d", f.seed) |
| + if f.name != "" { |
| + what = "scenario " + f.name |
| + } |
| + t.Errorf("%s failed at step %d:\n %s", what, f.step, strings.Join(f.bad, "\n ")) |
| } |
| if len(fails) > 0 { |
| log := fails[0].log |
| if lines := strings.Split(log, "\n"); len(lines) > simLogLines { |
| log = fmt.Sprintf("(%d earlier lines left out)\n%s", len(lines)-simLogLines, strings.Join(lines[len(lines)-simLogLines:], "\n")) |
| } |
| - t.Logf("step log of seed %d (EQUIPO_SIM_SEED=%d replays it):\n%s", fails[0].seed, fails[0].seed, log) |
| + what := fmt.Sprintf("seed %d (EQUIPO_SIM_SEED=%d replays it)", fails[0].seed, fails[0].seed) |
| + if fails[0].name != "" { |
| + what = "scenario " + fails[0].name |
| + } |
| + t.Logf("step log of %s:\n%s", what, log) |
| } |
| } |
| @@ -131,6 +147,7 @@ const ( |
| const simActor hostedwire.KeyID = "inst-1" |
| type simFailure struct { |
| + name string // a directed scenario's; empty for a random seed |
| seed int64 |
| step int |
| bad []string |
| @@ -161,6 +178,7 @@ type simModel struct { |
| ops map[string][]string // resume operation IDs used, per attempt |
| done map[[2]string]int64 // (attempt, operation) -> epoch, once seen done |
| returned []simReturned |
| + deferredAt map[isolatedjob.Ref]T // last check at which R22 deferral covered the VM |
| } |
| // simWorld is one seed's controller, store, fake and model clock. |
| @@ -206,7 +224,7 @@ func newSimWorld(dir string, seed int64) *simWorld { |
| path: filepath.Join(dir, fmt.Sprintf("sim-%d.db", seed)), clk: clk, fake: fake, |
| cfg: Config{Enabled: true, Images: map[isolatedjob.ImageDigest]bool{imgA: true}}, |
| m: simModel{req: map[string]LaunchRequest{}, stopAt: map[string]T{}, pause: map[string]*simPause{}, |
| - ops: map[string][]string{}, done: map[[2]string]int64{}}, |
| + ops: map[string][]string{}, done: map[[2]string]int64{}, deferredAt: map[isolatedjob.Ref]T{}}, |
| } |
| w.run = newSimRunner(fake, w) |
| // Swarm testing: each seed leaves out some kinds of step, so some |
| @@ -227,14 +245,16 @@ func (w *simWorld) logf(format string, args ...any) { |
| w.lines = append(w.lines, fmt.Sprintf(format, args...)) |
| } |
| -func runSimSeed(dir string, seed int64, template []byte) (f *simFailure) { |
| +// runSim runs one seed's random steps, or one directed scenario, in a world |
| +// of its own, and returns its failure, if any. |
| +func runSim(dir string, seed int64, template []byte, name string, body func(*simWorld)) (f *simFailure) { |
| w := newSimWorld(dir, seed) |
| defer w.cleanup() |
| if err := os.WriteFile(w.path, template, 0o600); err != nil { |
| - return &simFailure{seed: seed, bad: []string{err.Error()}} |
| + return &simFailure{name: name, seed: seed, bad: []string{err.Error()}} |
| } |
| fail := func(bad ...string) *simFailure { |
| - return &simFailure{seed: seed, step: w.step, bad: bad, log: strings.Join(w.lines, "\n")} |
| + return &simFailure{name: name, seed: seed, step: w.step, bad: bad, log: strings.Join(w.lines, "\n")} |
| } |
| defer func() { |
| if p := recover(); p != nil { |
| @@ -244,22 +264,45 @@ func runSimSeed(dir string, seed int64, template []byte) (f *simFailure) { |
| if err := w.open(); err != nil { |
| return fail(err.Error()) |
| } |
| - if !w.pass() { |
| + if w.pass() { |
| + body(w) |
| + } |
| + if w.bad != nil { |
| return fail(w.bad...) |
| } |
| - for w.step = 1; w.step <= simSteps; w.step++ { |
| - w.opT = w.now() |
| + return nil |
| +} |
| + |
| +func (w *simWorld) randomSteps() { |
| + for range simSteps { |
| op := w.pickOp() |
| - w.logf("step %d at %v: %s", w.step, simDur(w.opT), op.name) |
| - w.logf(" %s", op.run(w)) |
| - if w.bad == nil { |
| - w.verify() |
| - } |
| - if w.bad != nil { |
| - return fail(w.bad...) |
| + if !w.do(op.name, func() string { return op.run(w) }) { |
| + return |
| } |
| } |
| - return nil |
| +} |
| + |
| +// do runs one step: it logs it, runs it, then the invariants. It reports |
| +// whether everything still holds. |
| +func (w *simWorld) do(what string, run func() string) bool { |
| + w.step++ |
| + w.opT = w.now() |
| + w.logf("step %d at %v: %s", w.step, simDur(w.opT), what) |
| + w.logf(" %s", run()) |
| + if w.bad == nil { |
| + w.verify() |
| + } |
| + return w.bad == nil |
| +} |
| + |
| +// want is a directed scenario's own expectation, checked after the |
| +// invariants: a scenario that does not reach the state it means to test |
| +// fails rather than passing vacuously. |
| +func (w *simWorld) want(ok bool, format string, args ...any) bool { |
| + if !ok && w.bad == nil { |
| + w.bad = []string{"scenario: " + fmt.Sprintf(format, args...)} |
| + } |
| + return w.bad == nil |
| } |
| func (w *simWorld) cleanup() { |
| @@ -301,6 +344,9 @@ func (w *simWorld) open() error { |
| return fmt.Errorf("new: %w", err) |
| } |
| w.store, w.c, w.opened = s, c, true |
| + w.run.mu.Lock() |
| + w.run.openPass = w.run.passNo |
| + w.run.mu.Unlock() |
| return nil |
| } |
| @@ -345,7 +391,9 @@ func (w *simWorld) pass() bool { |
| // advance moves time forward by d in steps of at most ReapInterval, with |
| // the provider's progress (Tick) and a reaper pass at each step. While |
| // nothing can change it skips ahead, but never past a recorded drain or stop |
| -// time, where a pass runs. |
| +// time, where a pass runs, and never while a fault window (failing audits, |
| +// incomplete Lists) or a queued List fault would have played out in the |
| +// passes left out: a quiet pass calls only List and the audit. |
| func (w *simWorld) advance(d time.Duration) string { |
| passes := 0 |
| for d > 0 && w.bad == nil { |
| @@ -353,18 +401,13 @@ func (w *simWorld) advance(d time.Duration) string { |
| if step > time.Second && w.rng.Intn(4) == 0 { |
| step = time.Duration(1+w.rng.Int63n(int64(step/time.Second))) * time.Second |
| } |
| - if d > ReapInterval && w.snap.quiet() { |
| + if d > ReapInterval && w.snap.quiet() && w.faultFree() { |
| skip := d |
| if at, ok := w.snap.nextEvent(w.now()); ok && time.Duration(at-w.now()) < skip { |
| skip = time.Duration(at - w.now()) |
| } |
| if skip > step { |
| step = skip |
| - skipped := int(skip / ReapInterval) |
| - w.auditBad = max(0, w.auditBad-skipped) |
| - w.run.mu.Lock() |
| - w.run.incomplete = max(0, w.run.incomplete-skipped) |
| - w.run.mu.Unlock() |
| w.logf(" quiet: skip %v", skip) |
| } |
| } |
| @@ -383,6 +426,14 @@ func (w *simWorld) advance(d time.Duration) string { |
| // the pause protocol (drain, acknowledge, suspend, resume) is followed |
| // often enough to reach its later steps; the step itself still picks any |
| // job, and the generation or operation it names, at random. |
| +// faultFree reports whether no failing audit, incomplete-List window or |
| +// queued List fault is waiting for a pass. |
| +func (w *simWorld) faultFree() bool { |
| + w.run.mu.Lock() |
| + defer w.run.mu.Unlock() |
| + return w.auditBad == 0 && w.run.incomplete == 0 && len(w.run.pending[isolatedjob.OpList]) == 0 |
| +} |
| + |
| type simOp struct { |
| name string |
| weight int |
| @@ -583,6 +634,9 @@ func (w *simWorld) opDuplicate() string { |
| q = w.newRequest("") |
| } |
| lost := w.maybeLost(isolatedjob.OpLaunch, 3) |
| + // The two goroutines run in whatever order the scheduler picks, so a |
| + // seed fixes which requests race but not which one wins, or which |
| + // one meets a queued fault: replaying a seed can differ here. |
| out := make([]string, 2) |
| var wg sync.WaitGroup |
| for i := range out { |
| @@ -598,22 +652,12 @@ func (w *simWorld) opDuplicate() string { |
| } |
| func (w *simWorld) opCrash() string { |
| - if err := w.close(); err != nil { |
| - w.bad = []string{"close: " + err.Error()} |
| - return "close failed" |
| - } |
| - var down time.Duration |
| + var down, extra time.Duration |
| if w.rng.Intn(2) == 0 { |
| down = time.Duration(1+w.rng.Intn(1200)) * time.Second |
| } |
| - wall := w.clk.Wall().Add(down) |
| if w.rng.Intn(3) == 0 { |
| - wall = wall.Add(time.Duration(w.rng.Intn(7200)-3600) * time.Second) |
| - } |
| - w.clk.AdvanceMono(down) |
| - w.clk.SetWall(wall) |
| - if down > 0 { |
| - w.fake.Tick() |
| + extra = time.Duration(w.rng.Intn(7200)-3600) * time.Second |
| } |
| switch { |
| case w.cfg.Enabled && w.rng.Intn(8) == 0: |
| @@ -621,12 +665,29 @@ func (w *simWorld) opCrash() string { |
| case !w.cfg.Enabled && w.rng.Intn(2) == 0: |
| w.cfg.Enabled = true |
| } |
| + return w.crash(down, extra, w.rng.Intn(10) < 7) |
| +} |
| + |
| +// crash closes the store, lets down pass (the wall clock moves down plus |
| +// extra), opens it again and builds a new controller; with pass, the first |
| +// reaper pass runs at once, as Loop's does. |
| +func (w *simWorld) crash(down, extra time.Duration, pass bool) string { |
| + if err := w.close(); err != nil { |
| + w.bad = []string{"close: " + err.Error()} |
| + return "close failed" |
| + } |
| + wall := w.clk.Wall().Add(down + extra) |
| + w.clk.AdvanceMono(down) |
| + w.clk.SetWall(wall) |
| + if down > 0 { |
| + w.fake.Tick() |
| + } |
| if err := w.open(); err != nil { |
| w.bad = []string{err.Error()} |
| return "reopen failed" |
| } |
| out := fmt.Sprintf("down %v, wall moved %v, launches enabled %v", down, wall.Sub(w.cpWall), w.cfg.Enabled) |
| - if w.rng.Intn(10) < 7 { |
| + if pass { |
| w.pass() |
| out += ", first pass run" |
| } |
| @@ -692,14 +753,50 @@ func (w *simWorld) opDrain() string { |
| if id == "" { |
| return "no job to drain" |
| } |
| - gen, err := w.c.Drain(w.ctx, simActor, instKey, id) |
| + gen, err := w.drain(id) |
| if err == nil { |
| - w.m.pause[id] = &simPause{gen: gen, drainedAt: w.now(), open: true} |
| w.follow = "acknowledge quiescent" |
| } |
| return fmt.Sprintf("drain %s -> generation %d %s", id, gen, errText(err)) |
| } |
| +func (w *simWorld) drain(id string) (int64, error) { |
| + gen, err := w.c.Drain(w.ctx, simActor, instKey, id) |
| + if err == nil { |
| + w.m.pause[id] = &simPause{gen: gen, drainedAt: w.now(), open: true} |
| + } |
| + return gen, err |
| +} |
| + |
| +// ack sends Quiescent for gen and records an in-time acknowledgement of |
| +// the current generation in the model's history. |
| +func (w *simWorld) ack(id string, gen int64) error { |
| + err := w.c.Quiescent(w.ctx, simActor, instKey, id, gen) |
| + if p := w.m.pause[id]; err == nil && p != nil && p.open && gen == p.gen && w.now()-p.drainedAt <= T(PauseAckTimeout) { |
| + p.acked = true |
| + } |
| + return err |
| +} |
| + |
| +func (w *simWorld) suspend(id string, gen int64) error { |
| + w.run.mu.Lock() |
| + w.run.suspendOp = &simGen{attempt: id, gen: gen} |
| + w.run.mu.Unlock() |
| + err := w.c.Suspend(w.ctx, simActor, instKey, id, gen) |
| + w.run.mu.Lock() |
| + w.run.suspendOp = nil |
| + w.run.mu.Unlock() |
| + return err |
| +} |
| + |
| +func (w *simWorld) resume(id, op string) (int64, error) { |
| + epoch, err := w.c.Resume(w.ctx, simActor, instKey, id, op) |
| + if err == nil { // a commit, if this call made one, closes the pause in check |
| + w.m.returned = append(w.m.returned, simReturned{attempt: id, op: op, epoch: epoch}) |
| + } |
| + return epoch, err |
| +} |
| + |
| func (w *simWorld) opAck() string { |
| id := w.pickReady(simToAck, JobDraining) |
| if id == "" { |
| @@ -710,9 +807,8 @@ func (w *simWorld) opAck() string { |
| if kind == "current" && p != nil && w.now()-p.drainedAt > T(PauseAckTimeout) { |
| kind = "late" |
| } |
| - err := w.c.Quiescent(w.ctx, simActor, instKey, id, gen) |
| - if err == nil && p != nil && p.open && gen == p.gen && w.now()-p.drainedAt <= T(PauseAckTimeout) { |
| - p.acked = true |
| + err := w.ack(id, gen) |
| + if err == nil && p != nil && p.acked && gen == p.gen { |
| w.follow = "suspend" |
| } |
| return fmt.Sprintf("quiescent %s generation %d (%s) -> %s", id, gen, kind, errText(err)) |
| @@ -729,13 +825,7 @@ func (w *simWorld) opSuspend() string { |
| w.run.queue(isolatedjob.OpSuspend, isolatedjob.FaultThrottle) |
| fault = " (throttled)" |
| } |
| - w.run.mu.Lock() |
| - w.run.suspendOp = &simGen{attempt: id, gen: gen} |
| - w.run.mu.Unlock() |
| - err := w.c.Suspend(w.ctx, simActor, instKey, id, gen) |
| - w.run.mu.Lock() |
| - w.run.suspendOp = nil |
| - w.run.mu.Unlock() |
| + err := w.suspend(id, gen) |
| if err == nil { |
| w.follow, w.short = "time advance", true |
| } |
| @@ -769,17 +859,15 @@ func (w *simWorld) opResume() string { |
| w.m.ops[id] = append(w.m.ops[id], op) |
| } |
| lost := w.maybeLost(isolatedjob.OpResume, 3) |
| - epoch, err := w.c.Resume(w.ctx, simActor, instKey, id, op) |
| - if err == nil { |
| - w.m.returned = append(w.m.returned, simReturned{attempt: id, op: op, epoch: epoch}) |
| - w.closePause(id) |
| - } else { |
| + epoch, err := w.resume(id, op) |
| + if err != nil { |
| w.follow, w.short = "time advance", true |
| } |
| return fmt.Sprintf("resume %s operation %s (%s)%s -> epoch %d %s", id, op, kind, lost, epoch, errText(err)) |
| } |
| -// closePause records that the pause of attempt ended in a committed resume. |
| +// closePause records that the pause of attempt ended in a newly committed |
| +// resume. |
| func (w *simWorld) closePause(id string) { |
| if p := w.m.pause[id]; p != nil { |
| p.open, p.acked = false, false |
| @@ -819,7 +907,7 @@ func (w *simWorld) opEnd() string { |
| return "no live VM" |
| } |
| ref := refs[w.rng.Intn(len(refs))] |
| - _ = w.fake.Stop(w.ctx, ref, "ended") // the provider's own doing: no controller call |
| + w.run.end(ref) // the provider's own doing: no controller call |
| return fmt.Sprintf("%s ends by itself", ref) |
| } |
| @@ -858,6 +946,167 @@ func (w *simWorld) opAdvance() string { |
| return out |
| } |
| +// simScenarios are directed sequences with fixed choices, run before the |
| +// random seeds under the same invariants. Each crash after a lost reply |
| +// first confirms the provider's effect and the unresolved store state, then |
| +// reopens before anything reconciles; the others reach, every run, the |
| +// states the thinnest random coverage depends on. |
| +var simScenarios = []struct { |
| + name string |
| + run func(*simWorld) |
| +}{ |
| + {"lost launch reply, crash, reconcile", (*simWorld).scLostLaunch}, |
| + {"lost stop reply, crash, reconcile", (*simWorld).scLostStop}, |
| + {"lost resume reply, crash, reconcile", (*simWorld).scLostResume}, |
| + {"throttled resume while the VM stays suspended", (*simWorld).scThrottledResume}, |
| + {"a waiting intent's VM outlives its orphan grace", (*simWorld).scOrphanRecheck}, |
| + {"future generations are refused", (*simWorld).scFutureGen}, |
| +} |
| + |
| +// launchFor launches a new attempt with lifetime life, its reply lost when |
| +// lost, and returns its ID and Launch's error. |
| +func (w *simWorld) launchFor(life time.Duration, lost bool) (string, error) { |
| + q := w.newRequest("") |
| + q.MaxLifetime = life |
| + w.m.req[q.AttemptID] = q |
| + if lost { |
| + w.run.queue(isolatedjob.OpLaunch, isolatedjob.FaultLostReply) |
| + } |
| + _, err := w.c.Launch(w.ctx, simActor, instKey, q) |
| + return q.AttemptID, err |
| +} |
| + |
| +// vmsOf returns the VMs of attempt id in the latest snapshot. |
| +func (w *simWorld) vmsOf(id string) []isolatedjob.Job { |
| + w.run.mu.Lock() |
| + defer w.run.mu.Unlock() |
| + var out []isolatedjob.Job |
| + for _, vm := range w.snap.vms { |
| + if w.run.ownerLocked(w.snap, vm.Ref) == id { |
| + out = append(out, vm) |
| + } |
| + } |
| + return out |
| +} |
| + |
| +// oneVM reports whether attempt id has exactly one VM, in state st. |
| +func (w *simWorld) oneVM(id string, st isolatedjob.State) bool { |
| + vms := w.vmsOf(id) |
| + return w.want(len(vms) == 1 && vms[0].State == st, "%s has VMs %+v, want one %s", id, vms, st) |
| +} |
| + |
| +func (w *simWorld) try(what string, run func() error, ok func(error) bool) bool { |
| + var err error |
| + return w.do(what, func() string { err = run(); return errText(err) }) && w.want(ok(err), "%s: unexpected result %v", what, err) |
| +} |
| + |
| +func (w *simWorld) wait(d time.Duration) bool { |
| + return w.do(fmt.Sprintf("advance %v", d), func() string { return w.advance(d) }) |
| +} |
| + |
| +func simOK(err error) bool { return err == nil } |
| + |
| +// running launches an attempt with lifetime life and waits for it to run. |
| +func (w *simWorld) running(life time.Duration) (string, bool) { |
| + var id string |
| + ok := w.try("launch", func() (err error) { id, err = w.launchFor(life, false); return err }, simOK) && |
| + w.wait(ReapInterval) && w.want(w.snap.jobs[id].state == JobRunning, "%s is %s, want running", id, w.snap.jobs[id].state) |
| + return id, ok |
| +} |
| + |
| +// suspended runs an attempt through drain, acknowledgement and suspend |
| +// until the store holds it suspended. |
| +func (w *simWorld) suspended() (string, bool) { |
| + id, ok := w.running(time.Hour) |
| + var gen int64 |
| + ok = ok && w.try("drain", func() (err error) { gen, err = w.drain(id); return err }, simOK) && |
| + w.try("acknowledge", func() error { return w.ack(id, gen) }, simOK) && |
| + w.try("suspend", func() error { return w.suspend(id, gen) }, simOK) && |
| + w.wait(ReapInterval) && w.want(w.snap.jobs[id].state == JobSuspended, "%s is %s, want suspended", id, w.snap.jobs[id].state) |
| + return id, ok |
| +} |
| + |
| +func (w *simWorld) scLostLaunch() { |
| + var id string |
| + _ = w.try("launch with its reply lost", func() (err error) { id, err = w.launchFor(time.Hour, true); return err }, |
| + func(err error) bool { return errors.Is(err, ErrProviderLaunch) }) && |
| + w.oneVM(id, isolatedjob.StateStarting) && |
| + w.want(w.snap.jobs[id].state == JobWaiting && w.snap.jobs[id].ref == "" && w.snap.jobs[id].dispatched, |
| + "%s after the lost reply: %+v, want a dispatched waiting intent with no Ref", id, w.snap.jobs[id]) && |
| + w.do("crash before any reconciliation", func() string { return w.crash(0, 0, false) }) && |
| + w.wait(2*ReapInterval) && w.oneVM(id, isolatedjob.StateRunning) && |
| + w.want(w.snap.jobs[id].ref == w.vmsOf(id)[0].Ref, "%s holds Ref %q after the replays", id, w.snap.jobs[id].ref) && |
| + w.wait(time.Hour) && w.want(w.snap.jobs[id].proof != "", "%s has no proof after its stop time", id) |
| +} |
| + |
| +func (w *simWorld) scLostStop() { |
| + id, ok := w.running(time.Hour) |
| + _ = ok && w.try("stop with its reply lost", func() error { |
| + w.run.queue(isolatedjob.OpStop, isolatedjob.FaultLostReply) |
| + _, err := w.c.Stop(w.ctx, simActor, instKey, id, "scenario stop") |
| + return err |
| + }, func(err error) bool { return errors.Is(err, isolatedjob.ErrLostReply) }) && |
| + w.oneVM(id, isolatedjob.StateStopping) && |
| + w.want(w.snap.jobs[id].stopRequested && w.snap.jobs[id].proof == "", "%s after the lost stop: %+v", id, w.snap.jobs[id]) && |
| + w.do("crash before any reconciliation", func() string { return w.crash(0, 0, false) }) && |
| + w.wait(2*ReapInterval) && w.want(w.snap.jobs[id].proof != "", "%s has no proof after the reopen", id) |
| +} |
| + |
| +func (w *simWorld) scLostResume() { |
| + id, ok := w.suspended() |
| + var epoch int64 |
| + _ = ok && w.try("resume op-1 with its reply lost", func() (err error) { |
| + w.run.queue(isolatedjob.OpResume, isolatedjob.FaultLostReply) |
| + _, err = w.resume(id, "op-1") |
| + return err |
| + }, func(err error) bool { return errors.Is(err, ErrResumePending) }) && |
| + w.do("the provider finishes the resume", func() string { w.fake.Tick(); return "tick" }) && |
| + w.oneVM(id, isolatedjob.StateRunning) && |
| + w.want(w.snap.jobs[id].state == JobResuming && w.snap.jobs[id].epoch == 0 && len(w.snap.ops) == 1 && w.snap.ops[0].status == opPending, |
| + "%s after the lost resume: %+v, operations %+v", id, w.snap.jobs[id], w.snap.ops) && |
| + w.do("crash before any reconciliation", func() string { return w.crash(0, 0, false) }) && |
| + w.wait(2*ReapInterval) && w.want(w.snap.jobs[id].epoch == 1, "%s epoch %d after recovery, want 1", id, w.snap.jobs[id].epoch) && |
| + w.try("resume op-1 again", func() (err error) { epoch, err = w.resume(id, "op-1"); return err }, simOK) && |
| + w.want(epoch == 1, "the repeated op-1 returned epoch %d, want 1", epoch) |
| +} |
| + |
| +func (w *simWorld) scThrottledResume() { |
| + id, ok := w.suspended() |
| + _ = ok && w.try("resume op-1, the provider call throttled", func() (err error) { |
| + w.run.queue(isolatedjob.OpResume, isolatedjob.FaultThrottle) |
| + _, err = w.resume(id, "op-1") |
| + return err |
| + }, func(err error) bool { return errors.Is(err, ErrResumePending) }) && |
| + w.oneVM(id, isolatedjob.StateSuspended) && |
| + w.want(w.snap.jobs[id].epoch == 0, "%s committed epoch %d with no provider resume", id, w.snap.jobs[id].epoch) && |
| + w.wait(3*ReapInterval) && w.want(w.snap.jobs[id].epoch == 1, "%s epoch %d once Refresh resumed it, want 1", id, w.snap.jobs[id].epoch) |
| +} |
| + |
| +func (w *simWorld) scOrphanRecheck() { |
| + var id string |
| + _ = w.try("launch with its reply lost", func() (err error) { id, err = w.launchFor(2*time.Hour, true); return err }, |
| + func(err error) bool { return errors.Is(err, ErrProviderLaunch) }) && |
| + w.do("the network audit fails from now, for 15 passes", func() string { |
| + w.auditBad = 15 |
| + w.fake.SetAudit(isolatedjob.NetworkAudit{IngressClosed: true, RouteOutAbsent: true}, nil) |
| + return errText(w.c.RunAudit(w.ctx)) // recorded now, so no replay can claim the VM |
| + }) && |
| + w.wait(12*time.Minute) && w.oneVM(id, isolatedjob.StateRunning) && |
| + w.want(w.snap.jobs[id].state == JobWaiting, "%s is %s, want still waiting", id, w.snap.jobs[id].state) && |
| + w.wait(6*time.Minute) && w.want(w.snap.jobs[id].ref == w.vmsOf(id)[0].Ref, "%s did not claim its VM once audits passed", id) |
| +} |
| + |
| +func (w *simWorld) scFutureGen() { |
| + id, ok := w.running(time.Hour) |
| + var gen int64 |
| + refused := func(err error) bool { return errors.Is(err, ErrGenerationCancelled) } |
| + _ = ok && w.try("drain", func() (err error) { gen, err = w.drain(id); return err }, simOK) && |
| + w.try("acknowledge the next generation", func() error { return w.ack(id, gen+1) }, refused) && |
| + w.try("acknowledge the current generation", func() error { return w.ack(id, gen) }, simOK) && |
| + w.try("suspend the next generation", func() error { return w.suspend(id, gen+1) }, refused) && |
| + w.try("suspend the current generation", func() error { return w.suspend(id, gen) }, simOK) |
| +} |
| + |
| func viewText(v JobView, err error) string { |
| if err != nil { |
| return errText(err) |