oficina / equipo Public

hostedctl: resume respects deadlines, proof fails pending resumes

Review r1 of Task 12. Every live VM read by Resume clears the first
not-found, so a stale one never pairs with a later one into stop proof.
Resume recovery (a retry, the Refresh hook, Reopen) never goes past the
job's stop time: a pending operation there is failed with no provider
call, and the time is checked again before the call and before the
commit. After a restart, recovery waits until Refresh has re-based the
job's times. writeProof fails a pending resume in the transaction that
saves the proof, on every proof path. Task 12 tests run in parallel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 06a90051a3ee8dffbc238da3a52a961ed7b72bfa parent 8e29640
6 files changed, +406 −76
  • docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md +34 −0
  • internal/hostedctl/pause.go +7 −3
  • internal/hostedctl/pause_test.go +7 −1
  • internal/hostedctl/resume.go +159 −68
  • internal/hostedctl/resume_test.go +193 −2
  • internal/hostedctl/stop.go +6 −2

CI passed — 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   86G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type  Size Avail | ext4   96G   86G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 1.4s
ci-box: codex: fetched and verified in 3.4s
ci-box: codex-code-mode-host: fetched and verified in 1.3s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.3s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 10.0s
ci-box: pi: installed and verified in 7.4s
ci-box: opencode: installed and verified in 2.0s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 8.6s
ci-box: clone deepened in 3.5s
ci-box: file times set from content: 2881 files, 192 directories
ci-box: ready in 16.7s
=== 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 ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
  1.1s
+ go list -export -test -tags testbuild -f  ./...
  1.0s
+ 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

receipt: test step 1m21.02s 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 1m19.405s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m19.4s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 29.38, cpu waiting 20.55%, memory waiting 0.00%, io waiting 0.54%
--- 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 1m22.539s 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 1m20.935s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m20.93s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 29.38, cpu waiting 20.55%, 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.598s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m22.523s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m11.94s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.82s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.76s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 28.15, cpu waiting 20.14%, 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 1m34.77s 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 1m33.214s amadan.net/oficina/equipo/internal/headless
receipt: slow test 37.27s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 35.97s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 10.51s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 9.46s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 26.37, cpu waiting 16.88%, memory waiting 0.00%, io waiting 0.43%
--- 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.039s 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 1m35.32s amadan.net/oficina/equipo/internal/headless
receipt: slow test 59.15s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 11.31s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 10.17s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 8.85s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 5.84s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 24.82, cpu waiting 16.36%, 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 3m7.507s 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 3m5.459s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m43.69s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 24.1s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 11.58s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 8.14s amadan.net/oficina/equipo/internal/headless TestHeadlessClaudeSignIn
receipt: slow test 7.33s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 7.35, cpu waiting 3.79%, memory waiting 0.00%, io waiting 0.09%
--- 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.063s 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 1.87, cpu waiting 0.00%, 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.059s 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 1.87, cpu waiting 0.00%, memory waiting 0.00%, io waiting 2.09%
--- 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
budget note: internal/runner/thin took 4m28.183s, over the 45s its record on line 44 allows; reported only, timing fails on CI

receipt: test step 4m41.064s 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 4m28.183s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 36.96s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.88s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.8s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.46s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 6.81s amadan.net/oficina/equipo/internal/runner/thin TestOpenCodeStepsRealOpenCode
machine: 32 CPUs, load 2.00, cpu waiting 0.76%, memory waiting 0.00%, io waiting 0.01%
--- 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 47.035s 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.977s amadan.net/oficina/equipo/internal/runner
receipt: slow test 25.95s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.03s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 30.92, cpu waiting 20.77%, 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 46.247s 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 44.372s amadan.net/oficina/equipo/internal/runner
receipt: slow test 34.4s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 30.77s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.37s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.58s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 30.92, cpu waiting 20.77%, memory waiting 0.00%, io waiting 1.00%
--- 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.221s 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.4s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.12s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.52s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.11s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.35s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestCoordinatorTransientRefusalKeepsServing
machine: 32 CPUs, load 22.77, cpu waiting 16.02%, memory waiting 0.00%, io waiting 1.18%
--- 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 28.2%, load 16.57
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 1m3.488s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m1.587s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 25.92s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 25.82s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 23.87s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 21.45s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 21.16s amadan.net/oficina/equipo/internal/equipotest TestAuthorityReadsOneSnapshot
machine: 32 CPUs, load 26.37, cpu waiting 17.41%, 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 28.2%, load 16.57
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.176s 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 16.57, cpu waiting 11.42%, memory waiting 0.00%, io waiting 1.31%
--- 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 28.2%, load 16.57
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.368s 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.417s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 14.49s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 12.97s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 9.92s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 9.88s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 6.82s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 22.91, cpu waiting 14.32%, 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 28.2%, load 16.57
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 526ms 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 16.57, cpu waiting 12.62%, memory waiting 0.00%, io waiting 1.26%
--- 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 28.2%, load 16.57
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 719ms 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 16.57, cpu waiting 12.62%, memory waiting 0.00%, io waiting 1.26%
--- 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 28.2%, load 16.57
test lane rest: ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/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-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/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/equipo/team: 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
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.244s, over the 15s its record on line 40 allows; reported only, timing fails on CI

receipt: test step 2m15.737s against a 60s target (the gate's other steps are not in this figure)
receipt: 13 packages ran, 52 cached, 20 without tests, 0 failed
receipt: slow package 52.005s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 51.463s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 45.275s amadan.net/oficina/equipo/internal/equipo
receipt: slow package 39.84s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 39.244s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 21.29s amadan.net/oficina/equipo/internal/runner/provider/opencode TestOpenCodeAcceptanceHostileRepository
receipt: slow test 15s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringOfflineGo
receipt: slow test 10.89s amadan.net/oficina/equipo/internal/idtest TestIDCallbackGuardAndPendingNonce
receipt: slow test 10.82s amadan.net/oficina/equipo/internal/equipo TestAgentReadRechecksIdentity
receipt: slow test 9.51s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringMissingModuleCache
machine: 32 CPUs, load 9.76, cpu waiting 5.29%, 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.952s 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.447s amadan.net/oficina/equipo/internal/headless
receipt: slow test 37.46s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 15.33s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.65s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.83s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 5.63s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 28.15, cpu waiting 20.14%, 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.744s 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.076s amadan.net/oficina/equipo/internal/headless
receipt: slow test 26.44s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 22.51s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 14.21s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 10.21s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 7.85s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 26.37, cpu waiting 17.41%, 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 1m39.624s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m37.967s amadan.net/oficina/equipo/internal/headless
receipt: slow test 13.76s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.01s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 12.93s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 10.17s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 10.1s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsOpenCodeGoLimitRequired
machine: 32 CPUs, load 24.82, cpu waiting 15.82%, 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
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN   TestBrowserCopyContinue
time=2026-11-22T18:14:15.568Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T18:14:15.569Z level=INFO msg="startup phase done" phase=state_lock took=224µs
time=2026-11-22T18:14:15.569Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T18:14:15.569Z level=INFO msg="startup phase done" phase=claim_roots took=144µs
time=2026-11-22T18:14:15.569Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T18:14:15.610Z level=INFO msg="startup phase done" phase=sweep took=41.354ms
time=2026-11-22T18:14:15.610Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T18:14:15.610Z level=INFO msg="startup phase done" phase=credentials took=101µs
time=2026-11-22T18:14:15.610Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T18:14:15.653Z level=INFO msg="startup phase done" phase=open_state took=42.935ms
time=2026-11-22T18:14:15.654Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T18:14:15.654Z level=INFO msg=connecting host=127.0.0.1:39949 protocol=28
time=2026-11-22T18:14:15.657Z level=INFO msg=connected host=127.0.0.1:39949 took=2.623ms
time=2026-11-22T18:14:15.657Z level=INFO msg="capabilities gathering"
time=2026-11-22T18:14:15.658Z level=INFO msg="capabilities gathered" took=1.192ms tags=linux,claude,go
time=2026-11-22T18:14:15.662Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T18:14:15.664Z 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.89s)

--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserEmptyExplore
=== RUN   TestBrowserEmptyExplore
time=2026-11-22T18:14:46.454Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T18:14:46.454Z level=INFO msg="startup phase done" phase=state_lock took=59µs
time=2026-11-22T18:14:46.454Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T18:14:46.454Z level=INFO msg="startup phase done" phase=claim_roots took=83µs
time=2026-11-22T18:14:46.454Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T18:14:46.483Z level=INFO msg="startup phase done" phase=sweep took=28.767ms
time=2026-11-22T18:14:46.483Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T18:14:46.483Z level=INFO msg="startup phase done" phase=credentials took=94µs
time=2026-11-22T18:14:46.483Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T18:14:46.522Z level=INFO msg="startup phase done" phase=open_state took=39.63ms
time=2026-11-22T18:14:46.523Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T18:14:46.524Z level=INFO msg=connecting host=127.0.0.1:36011 protocol=28
time=2026-11-22T18:14:46.524Z level=INFO msg=connected host=127.0.0.1:36011 took=791µs
time=2026-11-22T18:14:46.525Z level=INFO msg="capabilities gathering"
time=2026-11-22T18:14:46.525Z level=INFO msg="capabilities gathered" took=601µs tags=linux,claude,go
time=2026-11-22T18:14:46.526Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T18:14:46.530Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-22T18:14:47.548Z 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.81s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m26.888s
FAIL	amadan.net/oficina/equipo/internal/headless	87.198s


receipt: test step 1m28.302s 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 1m26.888s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.23s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 11.17s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.48s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 10.46s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 8.07s amadan.net/oficina/equipo/internal/headless TestBrowserRefreshRace
exit status 1
+ 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 06a90051a3ee8dffbc238da3a52a961ed7b72bfa 1.89s 27.10
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
##############################################################################
FLAKE ./internal/headless:TestBrowserEmptyExplore browser-headless-rest 06a90051a3ee8dffbc238da3a52a961ed7b72bfa 5.81s 27.10
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 24.82, cpu waiting 15.82%, 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 997ms 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 835ms 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 244ms 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.167s 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 3.96, cpu waiting 1.60%, 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   (53s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 5.24s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.41s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 9.84s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 10.12s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 25.01s
+ 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   (55s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 14.99s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 12.78s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 11.75s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 13.57s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless   (22s)
ok ./internal/headless TestMixedVersions 20.67s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks   (1s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.79s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin   (0s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.05s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 30.72, cpu waiting 21.80%, memory waiting 0.00%, io waiting 0.84%
--- 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.074s 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 6.982s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 155ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 93ms 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 4.97s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.62s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 290ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 150ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 90ms amadan.net/oficina/equipo/internal/runner/provider/codex TestDirectJournalAdapterBarrier
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.15s 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.814s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 280ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 190ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryMalformedRecord
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryReusedPID
machine: 32 CPUs, load 6.05, cpu waiting 4.78%, 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 28.2%, load 16.57
shard 25: make runner-dead-references lanes-check build vet fmt-check budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2594 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: 94 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok  	amadan.net/oficina/equipo/internal/equipo	2.513s
machine: 32 CPUs, load 30.92, cpu waiting 20.25%, 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 28.2%, load 16.57
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 16.57, cpu waiting 12.62%, 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 28.2%, load 16.57
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 26.47, cpu waiting 17.00%, 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 28.2%, load 16.57
shard 28: make gitleaks
6:14PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
6:14PM INF 1124 commits scanned.
6:14PM INF scanned ~61832598 bytes (61.83 MB) in 13.9s
6:14PM INF no leaks found
machine: 32 CPUs, load 30.92, cpu waiting 20.25%, memory waiting 0.00%, io waiting 1.03%
=== perf ===
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -require TestPerfScreens,TestPerfBoot -tags perf -count=1 -p 1 -parallel 1 -run '^TestPerf' ./...
perf: GET /: median 1.03ms, worst 1.091ms, budget 150ms
perf: GET /api/runner/protocol: median 75µs, worst 104µs, budget 150ms
perf: GET /api/v1/account-setups/{id}: median 588µs, worst 645µs, budget 150ms
perf: GET /api/v1/accounts: median 421µs, worst 471µs, budget 150ms
perf: GET /api/v1/auth/devices: median 446µs, worst 472µs, budget 150ms
perf: GET /api/v1/budgets: median 498µs, worst 535µs, budget 150ms
perf: GET /api/v1/capabilities: median 254µs, worst 298µs, budget 150ms
perf: GET /api/v1/cards/{id}: median 1.294ms, worst 1.367ms, budget 150ms
perf: GET /api/v1/connections: median 639µs, worst 704µs, budget 150ms
perf: GET /api/v1/connections/{id}: median 603µs, worst 641µs, budget 150ms
perf: GET /api/v1/conversation: median 973µs, worst 1.026ms, budget 150ms
perf: GET /api/v1/conversation/cards: median 1.68ms, worst 1.778ms, budget 150ms
perf: GET /api/v1/coordinator: median 1.998ms, worst 2.072ms, budget 150ms
perf: GET /api/v1/invites/{id}: median 485µs, worst 527µs, budget 150ms
perf: GET /api/v1/journey: median 7.991ms, worst 8.164ms, budget 150ms
perf: GET /api/v1/me: median 470µs, worst 496µs, budget 150ms
perf: GET /api/v1/me/settings: median 536µs, worst 573µs, budget 150ms
perf: GET /api/v1/needs-you: median 7.677ms, worst 11.238ms, budget 150ms
perf: GET /api/v1/notifications: median 1.627ms, worst 1.669ms, budget 150ms
perf: GET /api/v1/onboarding: median 404µs, worst 438µs, budget 150ms
perf: GET /api/v1/people: median 451µs, worst 488µs, budget 150ms
perf: GET /api/v1/playbooks: median 590µs, worst 602µs, budget 150ms
perf: GET /api/v1/playbooks/{id}: median 536µs, worst 582µs, budget 150ms
perf: GET /api/v1/playbooks/{id}/template-diff: median 854µs, worst 939µs, budget 150ms
perf: GET /api/v1/preferences: median 762µs, worst 823µs, budget 150ms
perf: GET /api/v1/projects/{id}: median 463µs, worst 488µs, budget 150ms
perf: GET /api/v1/projects/{id}/settings: median 581µs, worst 628µs, budget 150ms
perf: GET /api/v1/roster: median 466µs, worst 521µs, budget 150ms
perf: GET /api/v1/runners/{id}: median 433µs, worst 438µs, budget 150ms
perf: GET /api/v1/specialists: median 8.227ms, worst 8.38ms, budget 150ms
perf: GET /api/v1/specialists/{id}: median 7.906ms, worst 7.994ms, budget 150ms
perf: GET /api/v1/specialists/{id}/template-diff: median 839µs, worst 858µs, budget 150ms
perf: GET /api/v1/tasks/{id}/plan: median 1.116ms, worst 1.173ms, budget 150ms
perf: GET /api/v1/tasks/{id}/thread: median 709µs, worst 770µs, budget 150ms
perf: GET /api/v1/teams: median 433µs, worst 466µs, budget 150ms
perf: GET /api/v1/templates: median 590µs, worst 611µs, budget 150ms
perf: GET /api/v1/templates/{id}: median 433µs, worst 466µs, budget 150ms
perf: GET /auth/callback: median 80µs, worst 100µs, budget 150ms
perf: GET /auth/devices/{id}: median 3.361ms, worst 3.389ms, budget 150ms
perf: GET /auth/verify: median 76µs, worst 106µs, budget 150ms
perf: GET /connections: median 3.633ms, worst 3.734ms, budget 150ms
perf: GET /conversation: median 7.485ms, worst 7.594ms, budget 150ms
perf: GET /conversation/connections: median 256µs, worst 265µs, budget 150ms
perf: GET /conversation/notebook: median 241µs, worst 270µs, budget 150ms
perf: GET /conversation/settings: median 3.915ms, worst 4.047ms, budget 150ms
perf: GET /conversation/settings/autonomy: median 3.69ms, worst 3.767ms, budget 150ms
perf: GET /conversation/settings/connections: median 6.341ms, worst 6.393ms, budget 150ms
perf: GET /conversation/settings/connections/add: median 6.35ms, worst 6.411ms, budget 150ms
perf: GET /conversation/settings/copy: median 3.524ms, worst 3.592ms, budget 150ms
perf: GET /conversation/settings/housekeeping: median 3.997ms, worst 4.054ms, budget 150ms
perf: GET /conversation/settings/machines: median 4.343ms, worst 4.464ms, budget 150ms
perf: GET /conversation/settings/machines/add: median 4.258ms, worst 4.406ms, budget 150ms
perf: GET /conversation/settings/notebook: median 3.27ms, worst 3.353ms, budget 150ms
perf: GET /conversation/settings/thinking: median 3.883ms, worst 3.979ms, budget 150ms
perf: GET /housekeeping: median 3.858ms, worst 3.919ms, budget 150ms
perf: GET /invites/new: median 674µs, worst 3.57ms, budget 150ms
perf: GET /invites/{id}: median 670µs, worst 728µs, budget 150ms
perf: GET /jobs: median 3.291ms, worst 3.49ms, budget 150ms
perf: GET /jobs/{id}: median 4.445ms, worst 4.573ms, budget 150ms
perf: GET /journey: median 11.971ms, worst 12.297ms, budget 150ms
perf: GET /nav/rail: median 3.165ms, worst 3.26ms, budget 150ms
perf: GET /needs-you: median 11.69ms, worst 12.056ms, budget 150ms
perf: GET /onboarding: median 4.191ms, worst 4.329ms, budget 150ms
perf: GET /people: median 3.54ms, worst 3.612ms, budget 150ms
perf: GET /playbook-suggestions/{suggestion}: median 5.127ms, worst 5.3ms, budget 150ms
perf: GET /playbooks: median 4.74ms, worst 4.909ms, budget 150ms
perf: GET /playbooks/new: median 4.89ms, worst 4.942ms, budget 150ms
perf: GET /playbooks/{id}: median 4.438ms, worst 4.575ms, budget 150ms
perf: GET /playbooks/{id}/edit: median 4.408ms, worst 4.489ms, budget 150ms
perf: GET /playbooks/{id}/template-diff: median 3.6ms, worst 3.721ms, budget 150ms
perf: GET /preferences: median 4.109ms, worst 4.19ms, budget 150ms
perf: GET /preferences/sources/{source}: median 3.897ms, worst 3.94ms, budget 150ms
perf: GET /projects: median 5.077ms, worst 5.091ms, budget 150ms
perf: GET /projects/accounts: median 3.483ms, worst 3.528ms, budget 150ms
perf: GET /projects/new: median 3.491ms, worst 3.579ms, budget 150ms
perf: GET /projects/{id}: median 10.677ms, worst 12.357ms, budget 150ms
perf: GET /projects/{id}/edit: median 3.619ms, worst 3.798ms, budget 150ms
perf: GET /runners/enrol: median 4.254ms, worst 4.426ms, budget 150ms
perf: GET /settings: median 3.291ms, worst 3.446ms, budget 150ms
perf: GET /settings/coordinator: median 5.269ms, worst 5.386ms, budget 150ms
perf: GET /settings/devices: median 3.149ms, worst 3.273ms, budget 150ms
perf: GET /settings/recovery: median 3.231ms, worst 3.339ms, budget 150ms
perf: GET /settings/recovery/release: median 3.287ms, worst 3.38ms, budget 150ms
perf: GET /settings/thinking: median 242µs, worst 270µs, budget 150ms
perf: GET /signin: median 321µs, worst 336µs, budget 150ms
perf: GET /specialists/new: median 3.291ms, worst 3.434ms, budget 150ms
perf: GET /specialists/{key}: median 10.642ms, worst 13.724ms, budget 150ms
perf: GET /specialists/{key}/edit: median 3.61ms, worst 3.742ms, budget 150ms
perf: GET /specialists/{key}/template-diff: median 3.639ms, worst 3.686ms, budget 150ms
perf: GET /tasks: median 5.074ms, worst 5.158ms, budget 150ms
perf: GET /tasks/new: median 3.09ms, worst 3.228ms, budget 150ms
perf: GET /tasks/{id}: median 5.286ms, worst 5.366ms, budget 150ms
perf: GET /tasks/{id}/merge: median 4.635ms, worst 4.726ms, budget 150ms
perf: GET /tasks/{id}/move: median 4.446ms, worst 4.542ms, budget 150ms
perf: GET /tasks/{id}/plan: median 5.499ms, worst 5.556ms, budget 150ms
perf: GET /tasks/{id}/preview: median 1.515ms, worst 1.551ms, budget 150ms
perf: GET /tasks/{id}/questions/{question}: median 5.066ms, worst 5.131ms, budget 150ms
perf: GET /tasks/{id}/rendered-change: median 4.74ms, worst 7.401ms, budget 150ms
perf: GET /tasks/{id}/rendered-change/{hash}.png: median 4.246ms, worst 4.347ms, budget 150ms
perf: GET /tasks/{id}/thread: median 7.809ms, worst 7.968ms, budget 150ms
perf: GET /team/{specialist}: median 4.218ms, worst 4.339ms, budget 150ms
perf: GET /teams: median 9.775ms, worst 10.006ms, budget 150ms
perf: GET /templates: median 3.344ms, worst 3.374ms, budget 150ms
perf: GET /usage: median 4.07ms, worst 4.144ms, budget 150ms
perf: GET /work: median 2.973ms, worst 3.006ms, budget 150ms
perf: cold boot: median 264ms of [260.279287ms 263.543519ms 263.998531ms], budget 500ms

receipt: test step 30.606s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 90 without tests, 0 failed
receipt: slow package 8.863s amadan.net/oficina/equipo/internal/equipotest
receipt: slow package 0s amadan.net/oficina/equipo/cmd/equipo-runner
receipt: slow package 0s amadan.net/oficina/equipo/cmd/equipo-tool-proxy
receipt: slow package 0s amadan.net/oficina/equipo/internal/advice
receipt: slow package 0s amadan.net/oficina/equipo/internal/attach
receipt: slow test 8.02s amadan.net/oficina/equipo/internal/equipotest TestPerfScreens
receipt: slow test 840ms amadan.net/oficina/equipo/internal/equipotest TestPerfBoot
=== cache ===
ci-box: build cache /home/ci/work/repos/oficina__equipo/cache/go-build: 3.18 GiB in 22435 files
ci-box: module cache /home/ci/work/repos/oficina__equipo/cache/go-mod: 0.90 GiB in 32632 files
diff --git a/docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md b/docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md
index 72c4e598..e53639a8 100644
--- a/docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md
+++ b/docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md
@@ -489,3 +489,37 @@ added to states.go. No schema change.
| M9 Refresh hook bypassed (plain mirrorState) | `^TestSuspendRefreshSettles$` | `pause_test.go:276: Refresh of a draining job with a running VM left "running", not-found since {0 false}; want draining, cleared` | yes, passes |
| M10 hook leaves `notfound_since_t` for pause states | `^TestSuspendRefreshSettles$` | `pause_test.go:276: Refresh of a draining job with a running VM left "draining", not-found since {1 true}; want draining, cleared` | yes, passes |
| M11 a failed resume re-send fails Refresh | `^TestSuspendRefreshSettles$` | `pause_test.go:310: Refresh = isolatedjob: throttled: fake resume` | yes, passes |
+
+### Task 12 fix round 1 (review r1)
+
+1. Every live VM read by Resume clears `notfound_since_t` (finishResume, commitResume), the
+ controller state untouched, so a stale not-found never pairs with a later one into stop proof.
+2. Resume recovery respects the stop time. Resume's prepare fails a pending operation once the stop
+ time has come; driveResume checks the time again before the provider call and finishResume
+ before the commit; the Refresh hook fails a pending operation past the stop time (the job takes
+ the VM's state, no provider call, no commit) and skips a suspend re-send. Reopen past the stop
+ time is ErrPastDeadline. A pre-restart job whose times Refresh has not yet re-based
+ (`ageUnsettled`, refreshOne's untrusted test) gets no recovery from the hook on that pass, and
+ Resume answers ErrResumePending for it. Done operations still return their epoch.
+3. `writeProof` (stop.go) fails a pending resume in the transaction that saves the proof (one call
+ to `failPendingResume`), so Refresh's terminal and confirmed not-found proof, Stop's proof and
+ Ref-less proof all settle it. refresh.go is unchanged from HEAD in this round.
+4. Every Task 12 test runs with `t.Parallel()`.
+
+- GREEN: `go test ./internal/hostedctl -run 'TestSuspend|TestLateAck|TestResume' -count=1` ok 3.7 s;
+ whole package `-v` ok 3.9 s at load average 5 to 8 (slowest Task 12 test
+ TestResumePastDeadlineRefused 0.54 s); vet, gofmt, staticcheck v0.7.0 clean; `make budget` within.
+- All of M1 to M11 rechecked against the new code: each still fails on its assertion (M8 now trips
+ at `resume_test.go:337`, where the dispatch-time recheck fails the operation instead) and passes
+ restored.
+
+| Mutation | Test | Observed failure | Restored |
+| --- | --- | --- | --- |
+| F1 Resume's live read keeps the not-found | `^TestResumeLiveReadClearsNotFound$` | `resume_test.go:457: after a live read: not-found since {0 true}, state "resuming"; want cleared, resuming` | yes, passes |
+| F2a Refresh hook ignores the stop time | `^TestResumeRefreshPastDeadline$` | `resume_test.go:386: job "resuming" at epoch 0, ops [{op-1 pending ...}], 1 provider resumes; want "suspended" at 0, [{op-1 failed ...}], 1` | yes, passes |
+| F2b Refresh recovers before the restart re-base | `^TestResumeRestartRebasesFirst$` | `resume_test.go:412: job "running" at epoch 1, ops [{op-1 done ... 1}], 1 provider resumes; want "resuming" at 0, [{op-1 pending ...}], 1` | yes, passes |
+| F2c commit without the stop-time recheck | `^TestResumeDeadlineDuringProviderCall$` | `resume_test.go:431: Resume whose provider call crossed the stop time = (1, <nil>), want (0, ErrPastDeadline)` | yes, passes |
+| F2d Resume does not wait for the re-base | `^TestResumeCrashAfterProvider$` | `resume_test.go:213: Resume before the first refresh after a restart = <nil>, want ErrResumePending` | yes, passes |
+| F2e Reopen past the stop time | `^TestResumePastDeadlineRefused$` | `resume_test.go:368: Reopen at the stop time = <nil>, want ErrPastDeadline` | yes, passes |
+| F2f a pending operation past the stop time left pending | `^TestResumePastDeadlineRefused$` | `resume_test.go:356: job "resuming" at epoch 0, ops [{op-1 pending ...}] ...; want ... [{op-1 failed ...}], 1` | yes, passes |
+| F3 proof leaves a pending resume (writeProof's call removed) | `^TestResumeFailedByProof$` | all three subtests (ends on its own, gone confirmed, instance stops it): `resume_test.go:517: job "stopped" at epoch 0, ops [{op-1 pending ...}] ...; want "stopped" at 0, [{op-1 failed ...}], 1` | yes, passes |
diff --git a/internal/hostedctl/pause.go b/internal/hostedctl/pause.go
index e44b802b..eea4ca20 100644
--- a/internal/hostedctl/pause.go
+++ b/internal/hostedctl/pause.go
@@ -329,9 +329,10 @@ func (c *Controller) sendSuspend(ctx context.Context, actor hostedwire.KeyID, j
// Reopen records that the runner takes work again after a cancelled or
// abandoned pause of generation, the current one (else
// ErrGenerationCancelled). The job returns to JobRunning and its pause
-// fields are cleared; the generation counter stays. A job already running
-// at that generation gets nil; a suspending, suspended or resuming job gets
-// isolatedjob.ErrConflict, as its VM is paused and needs Resume.
+// fields are cleared; the generation counter stays. Once the job's stop
+// time has come admission never reopens (ErrPastDeadline). A job already
+// running at that generation gets nil; a suspending, suspended or resuming
+// job gets isolatedjob.ErrConflict, as its VM is paused and needs Resume.
func (c *Controller) Reopen(ctx context.Context, by hostedwire.KeyID, key hostedwire.VerifyKey, attemptID string, generation int64) error {
defer c.lockAttempt(attemptID)()
return c.creatorCall(ctx, by, key, attemptID, actionReopenRefused, func(tx *sql.Tx, j *pauseJob, a Audit) (error, error) {
@@ -344,6 +345,9 @@ func (c *Controller) Reopen(ctx context.Context, by hostedwire.KeyID, key hosted
if !currentGen(generation, j) {
return fmt.Errorf("%w: generation %d is not the current one (%d)", ErrGenerationCancelled, generation, j.generation), nil
}
+ if pastStop(j, a.At) {
+ return fmt.Errorf("%w: %v ago; admission stays closed", ErrPastDeadline, time.Duration(a.At-T(j.stopT))), nil
+ }
switch j.state {
case JobRunning:
a.Action, a.Reason = actionReopenRepeated, fmt.Sprintf("generation %d: admission already open", generation)
diff --git a/internal/hostedctl/pause_test.go b/internal/hostedctl/pause_test.go
index 332ccc30..53d3df33 100644
--- a/internal/hostedctl/pause_test.go
+++ b/internal/hostedctl/pause_test.go
@@ -79,6 +79,7 @@ func (e *launchEnv) suspendJob() int64 {
}
func TestSuspendNeedsCurrentAck(t *testing.T) {
+ t.Parallel()
for _, tc := range []struct {
name string
// setup opens generations and acknowledges as the case needs; it
@@ -95,7 +96,7 @@ func TestSuspendNeedsCurrentAck(t *testing.T) {
g1 := e.drain()
g2 := e.drain()
if err := e.c.Quiescent(e.ctx, "inst-1", instKey, "att-1", g1); !errors.Is(err, ErrGenerationCancelled) {
- t.Fatalf("Quiescent for a superseded generation = %v, want ErrGenerationCancelled", err)
+ e.t.Fatalf("Quiescent for a superseded generation = %v, want ErrGenerationCancelled", err)
}
e.ack(g2)
return g1, g2, true
@@ -112,6 +113,7 @@ func TestSuspendNeedsCurrentAck(t *testing.T) {
}, ErrGenerationCancelled},
} {
t.Run(tc.name, func(t *testing.T) {
+ t.Parallel()
e := runningJob(t)
asked, current, live := tc.setup(e)
if err := e.c.Suspend(e.ctx, "inst-1", instKey, "att-1", asked); !errors.Is(err, tc.wantErr) {
@@ -143,6 +145,7 @@ func TestSuspendNeedsCurrentAck(t *testing.T) {
}
func TestLateAckIgnored(t *testing.T) {
+ t.Parallel()
e := runningJob(t)
g := e.drain()
e.clk.AdvanceMono(PauseAckTimeout + time.Second)
@@ -187,6 +190,7 @@ func TestLateAckIgnored(t *testing.T) {
}
func TestSuspendedTimeCountsToDeadline(t *testing.T) {
+ t.Parallel()
e := runningJob(t)
before := e.stopCols("att-1")
e.suspendJob()
@@ -215,6 +219,7 @@ func TestSuspendedTimeCountsToDeadline(t *testing.T) {
}
func TestSuspendAndResumeRoles(t *testing.T) {
+ t.Parallel()
e := runningJob(t)
g := e.drain()
calls := map[string]func(by hostedwire.KeyID, key hostedwire.VerifyKey, attempt string) error{
@@ -268,6 +273,7 @@ func TestSuspendAndResumeRoles(t *testing.T) {
}
func TestSuspendRefreshSettles(t *testing.T) {
+ t.Parallel()
e := runningJob(t)
g := e.drain()
e.exec(`UPDATE jobs SET notfound_since_t = 1 WHERE attempt_id = 'att-1'`) // a first not-found
diff --git a/internal/hostedctl/resume.go b/internal/hostedctl/resume.go
index b7955f71..81e270f2 100644
--- a/internal/hostedctl/resume.go
+++ b/internal/hostedctl/resume.go
@@ -91,24 +91,78 @@ func pendingResumeOp(ctx context.Context, tx *sql.Tx, attempt string) (resumeOp,
return r, true, nil
}
+// failPendingResume marks attempt's pending resume, if any, failed inside
+// tx, with an audit row giving why. The row stays, so a retry of its
+// operation ID is refused rather than prepared again. writeProof calls it,
+// so every proof path fails a pending resume in the transaction that saves
+// the proof.
+func failPendingResume(ctx context.Context, tx *sql.Tx, account, task, attempt string, now T, why string) error {
+ res, err := tx.ExecContext(ctx, `UPDATE resume_ops SET status = ?, completed_t = ?
+ WHERE attempt_id = ? AND status = ?`, opFailed, int64(now), attempt, opPending)
+ if err != nil {
+ return fmt.Errorf("hostedctl: fail pending resume of %s: %w", attempt, err)
+ }
+ if n, err := res.RowsAffected(); err != nil || n == 0 {
+ return err
+ }
+ return appendAudit(tx, Audit{Account: account, Task: task, Attempt: attempt, Action: actionResumeFailed,
+ Reason: why, At: now})
+}
+
// failDeadResume marks j's pending resume failed, inside tx, when the job
// holds stop proof or has a stop request: that resume is never committed.
func failDeadResume(ctx context.Context, tx *sql.Tx, j *pauseJob, now T) error {
if !j.stopProof.Valid && !j.stopRequested.Valid {
return nil
}
- res, err := tx.ExecContext(ctx, `UPDATE resume_ops SET status = ?, completed_t = ?
- WHERE attempt_id = ? AND status = ?`, opFailed, int64(now), j.attempt, opPending)
- if err != nil {
- return fmt.Errorf("hostedctl: fail pending resume of %s: %w", j.attempt, err)
- }
- if n, err := res.RowsAffected(); err != nil || n == 0 {
+ return failPendingResume(ctx, tx, j.account, j.task, j.attempt, now,
+ "a stop was asked for before the pending resume committed")
+}
+
+// failResumeAtDeadline marks j's pending resume failed, inside tx, because
+// the job's stop time has come: a resume never commits past it and the
+// provider is not called again. observed is the VM state just read, or
+// empty when none was: a live one becomes the state of a resuming job (the
+// epoch is not raised) and clears notfound_since_t. With none the job stays
+// resuming, with no pending row, and the next Refresh mirrors the VM.
+func failResumeAtDeadline(ctx context.Context, tx *sql.Tx, j *pauseJob, now T, observed isolatedjob.State) error {
+ if err := failPendingResume(ctx, tx, j.account, j.task, j.attempt, now,
+ fmt.Sprintf("stop time passed %v ago before the pending resume committed", time.Duration(now-T(j.stopT)))); err != nil {
return err
}
- return appendAudit(tx, Audit{Account: j.account, Task: j.task, Attempt: j.attempt, Action: actionResumeFailed,
- Reason: "a stop was asked for before the pending resume committed", At: now})
+ if !observed.Live() {
+ return nil
+ }
+ if _, err := tx.ExecContext(ctx, `UPDATE jobs SET state = ?, revision = revision + 1
+ WHERE attempt_id = ? AND state = ?`, string(observed), j.attempt, JobResuming); err != nil {
+ return fmt.Errorf("hostedctl: settle resume of %s at its stop time: %w", j.attempt, err)
+ }
+ return clearNotFound(ctx, tx, j.attempt)
+}
+
+// clearNotFound drops attempt's first not-found inside tx: a live VM was
+// just seen, so it no longer counts towards stop proof. The job's state is
+// left alone.
+func clearNotFound(ctx context.Context, tx *sql.Tx, attempt string) error {
+ if _, err := tx.ExecContext(ctx, `UPDATE jobs SET notfound_since_t = NULL, revision = revision + 1
+ WHERE attempt_id = ? AND notfound_since_t IS NOT NULL`, attempt); err != nil {
+ return fmt.Errorf("hostedctl: clear not-found of %s: %w", attempt, err)
+ }
+ return nil
+}
+
+// ageUnsettled reports whether j existed before this process opened the
+// store and Refresh has not yet re-based its times from the provider's age
+// (or stopped it as elapsed_unknown): until then its stop time is not to be
+// trusted, so no resume is driven for it. It is refreshOne's test for an
+// untrusted elapsed time.
+func (c *Controller) ageUnsettled(j *pauseJob) bool {
+ return c.store.Restarted() && T(j.launchedT) <= c.store.OpenedAt() && !c.rebased.has(j.attempt)
}
+// pastStop reports whether j's stop time has come at now.
+func pastStop(j *pauseJob, now T) bool { return now >= T(j.stopT) }
+
// commitResume is step 3 inside tx, once the provider reports the VM
// running: the job's epoch becomes op's prepared epoch, which must be one
// above the stored epoch, the job is running with its pause closed (the
@@ -116,7 +170,7 @@ func failDeadResume(ctx context.Context, tx *sql.Tx, j *pauseJob, now T) error {
// pending, so an operation raises the epoch at most once.
func commitResume(ctx context.Context, tx *sql.Tx, j *pauseJob, op resumeOp, actor hostedwire.KeyID, now T) error {
res, err := tx.ExecContext(ctx, `UPDATE jobs SET epoch = ?, state = ?, pause_started_t = NULL, pause_quiescent = 0,
- pause_cancelled = 0, revision = revision + 1 WHERE attempt_id = ? AND epoch = ?`,
+ pause_cancelled = 0, notfound_since_t = NULL, revision = revision + 1 WHERE attempt_id = ? AND epoch = ?`,
op.prepared, JobRunning, j.attempt, op.prepared-1)
if err != nil {
return fmt.Errorf("hostedctl: commit resume of %s: %w", j.attempt, err)
@@ -144,19 +198,26 @@ func commitResume(ctx context.Context, tx *sql.Tx, j *pauseJob, op resumeOp, act
// 1. Prepare, in one transaction. A done operation returns its epoch with
// no provider call, whatever operations came after it; a failed one
// gets isolatedjob.ErrConflict. Then a stop request or proof gives
-// ErrConflict, and the job's stop time reached gives ErrPastDeadline,
-// with no provider call and no new row. A pending operation carries on
-// with its prepared epoch. A new operation while another is pending
+// ErrConflict; a job whose times wait for the first Refresh after a
+// restart (ageUnsettled) gives ErrResumePending; the job's stop time
+// reached gives ErrPastDeadline,
+// with no provider call and no new row; a pending operation is failed
+// then. A pending operation carries on with its prepared epoch. A new operation while another is pending
// gets ErrResumePending; one for a job that is not suspended gets
// ErrConflict. Otherwise a pending row with prepared epoch = epoch + 1
// is saved and the job becomes JobResuming.
-// 2. Outside any transaction, Runner.Resume. A failure is audited and
-// returned wrapped in ErrResumePending; the row stays pending.
-// 3. Runner.Get. Running: one transaction sets the job's epoch to the
-// prepared one and marks the row done (commitResume). Terminal: the row
-// is failed, the stop proof saved, and ErrConflict returned. Anything
-// else, still suspended included (the provider reports suspended while
-// the VM's resume hook runs): ErrResumePending, epoch 0.
+// 2. Outside any transaction, the stop time checked again, then
+// Runner.Resume. A failure is audited and returned wrapped in
+// ErrResumePending; the row stays pending.
+// 3. Runner.Get, then finishResume. Terminal: the stop proof is saved,
+// failing the row in the same transaction, and ErrConflict returned.
+// The stop time come meanwhile: the row is failed, ErrPastDeadline.
+// Running: one transaction sets the job's epoch to the prepared one and
+// marks the row done (commitResume). Anything else, still suspended
+// included (the provider reports suspended while the VM's resume hook
+// runs): ErrResumePending, epoch 0. Every live reading clears
+// notfound_since_t, so a stale not-found never combines with a later
+// one into stop proof.
//
// New-epoch credentials come from the prepared epoch, so the resume hook
// can finish before the commit. After a crash or a lost reply, a retry with
@@ -189,7 +250,15 @@ func (c *Controller) Resume(ctx context.Context, by hostedwire.KeyID, key hosted
if r := notPausable(j); r != nil {
return r, nil
}
- if a.At >= T(j.stopT) {
+ if c.ageUnsettled(j) {
+ return fmt.Errorf("%w: the job's times wait for the first refresh after a restart", ErrResumePending), nil
+ }
+ if pastStop(j, a.At) {
+ if found { // pending: it never commits now
+ if err := failResumeAtDeadline(ctx, tx, j, a.At, ""); err != nil {
+ return nil, err
+ }
+ }
return fmt.Errorf("%w: %v ago", ErrPastDeadline, time.Duration(a.At-T(j.stopT))), nil
}
if found {
@@ -233,10 +302,16 @@ func (c *Controller) Resume(ctx context.Context, by hostedwire.KeyID, key hosted
return c.driveResume(ctx, by, send, op)
}
-// driveResume is Resume's steps 2 and 3 for a prepared or pending op.
+// driveResume is Resume's steps 2 and 3 for a prepared or pending op. The
+// stop time is checked again just before the provider call and again in
+// the transaction that would commit (finishResume), so time that passes
+// during the calls cannot let a resume commit past it.
func (c *Controller) driveResume(ctx context.Context, actor hostedwire.KeyID, j *pauseJob, op resumeOp) (int64, error) {
ref := isolatedjob.Ref(j.ref.String)
rec := context.WithoutCancel(ctx) // record what the provider said even if the caller has gone
+ if now := c.store.Clock().Now(); pastStop(j, now) {
+ return c.finishResume(rec, actor, j, op.id, "", now)
+ }
if perr := c.runner.Resume(ctx, ref); perr != nil {
aerr := c.auditPause(rec, actor, j, actionResumeCallFailed,
fmt.Sprintf("operation %s: provider resume call failed; the operation stays pending", op.id))
@@ -244,35 +319,46 @@ func (c *Controller) driveResume(ctx context.Context, actor hostedwire.KeyID, j
}
job, gerr := c.runner.Get(ctx, ref)
at := c.store.Clock().Now()
- switch {
- case gerr != nil:
+ if gerr != nil {
return 0, fmt.Errorf("%w: operation %s: read VM %s: %w", ErrResumePending, op.id, ref, gerr)
- case job.State == isolatedjob.StateRunning || job.State.Terminal():
- return c.finishResume(rec, actor, j.attempt, op.id, job.State, at)
}
- return 0, fmt.Errorf("%w: operation %s: VM %s is %s", ErrResumePending, op.id, ref, job.State)
+ return c.finishResume(rec, actor, j, op.id, job.State, at)
}
-// finishResume settles operation opID of attempt once Get, ending at at,
-// reported st, running or terminal. Running commits it and returns the
-// epoch. Terminal marks it failed, saves the stop proof and returns
-// isolatedjob.ErrConflict. An operation already done returns its epoch.
-func (c *Controller) finishResume(ctx context.Context, actor hostedwire.KeyID, attempt, opID string, st isolatedjob.State, at T) (int64, error) {
+// finishResume settles operation opID of j's attempt from the VM state st
+// that a Get ending at at reported, or from no reading when st is empty.
+//
+// - Terminal: the stop proof is saved, which fails the pending operation
+// in the same transaction (writeProof); isolatedjob.ErrConflict.
+// - The job's stop time has come: the operation is failed
+// (failResumeAtDeadline); ErrPastDeadline.
+// - Running: commitResume; the epoch.
+// - Any other state: a live one clears notfound_since_t, the controller
+// state untouched; ErrResumePending.
+//
+// An operation already done returns its epoch; a failed one ErrConflict.
+func (c *Controller) finishResume(ctx context.Context, actor hostedwire.KeyID, j *pauseJob, opID string, st isolatedjob.State, at T) (int64, error) {
+ attempt := j.attempt
+ if st.Terminal() {
+ if _, err := c.recordProof(ctx, actor, attempt, StopProof{AttemptID: attempt, VMRef: isolatedjob.Ref(j.ref.String),
+ State: st, ObservedAt: at}, "resume: provider reports the VM "+string(st)); err != nil {
+ return 0, err
+ }
+ return 0, fmt.Errorf("%w: VM is %s; resume operation %s failed", isolatedjob.ErrConflict, st, opID)
+ }
var epoch int64
var refusal error
- var ref isolatedjob.Ref
err := c.store.Tx(ctx, func(tx *sql.Tx) error {
epoch, refusal = 0, nil
- j, found, err := loadPauseJob(ctx, tx, attempt)
+ p, found, err := loadPauseJob(ctx, tx, attempt)
if err != nil {
return err
}
if !found {
return fmt.Errorf("hostedctl: resume %s: job is missing", attempt)
}
- ref = isolatedjob.Ref(j.ref.String)
now := c.store.Clock().Now()
- if err := failDeadResume(ctx, tx, &j, now); err != nil {
+ if err := failDeadResume(ctx, tx, &p, now); err != nil {
return err
}
op, found, err := loadResumeOp(ctx, tx, attempt, opID)
@@ -287,31 +373,23 @@ func (c *Controller) finishResume(ctx context.Context, actor hostedwire.KeyID, a
case op.status != opPending:
refusal = fmt.Errorf("%w: resume operation %s failed", isolatedjob.ErrConflict, opID)
return nil
+ case pastStop(&p, now):
+ refusal = fmt.Errorf("%w: %v ago; resume operation %s failed", ErrPastDeadline, time.Duration(now-T(p.stopT)), opID)
+ return failResumeAtDeadline(ctx, tx, &p, now, st)
case st == isolatedjob.StateRunning:
epoch = op.prepared
- return commitResume(ctx, tx, &j, op, actor, now)
+ return commitResume(ctx, tx, &p, op, actor, now)
}
- if _, err := tx.ExecContext(ctx, `UPDATE resume_ops SET status = ?, completed_t = ?
- WHERE attempt_id = ? AND operation_id = ? AND status = ?`, opFailed, int64(now), attempt, opID, opPending); err != nil {
- return fmt.Errorf("hostedctl: fail resume %s of %s: %w", opID, attempt, err)
+ refusal = fmt.Errorf("%w: operation %s: VM %s is %s", ErrResumePending, opID, p.ref.String, st)
+ if !st.Live() {
+ return nil
}
- refusal = fmt.Errorf("%w: VM %s is %s; resume operation %s failed", isolatedjob.ErrConflict, ref, st, opID)
- return appendAudit(tx, Audit{Actor: actor, Account: j.account, Task: j.task, Attempt: attempt,
- Action: actionResumeFailed, Reason: fmt.Sprintf("operation %s: provider reports the VM %s", opID, st), At: now})
+ return clearNotFound(ctx, tx, attempt)
})
if err != nil {
return 0, err
}
- if refusal == nil {
- return epoch, nil
- }
- if st.Terminal() {
- if _, err := c.recordProof(ctx, actor, attempt, StopProof{AttemptID: attempt, VMRef: ref, State: st, ObservedAt: at},
- "resume: provider reports the VM "+string(st)); err != nil {
- return 0, errors.Join(refusal, err)
- }
- }
- return 0, refusal
+ return epoch, refusal
}
// auditPause writes one audit row about j in a short transaction.
@@ -345,20 +423,27 @@ func pauseState(state string) bool {
// - draining: the generation is cancelled if its acknowledgement is late;
// - suspending: a suspended VM makes the job JobSuspended; a VM still
// running gets Runner.Suspend again (the first call may never have
-// reached the provider);
-// - resuming: a running VM commits the pending operation (commitResume);
-// a suspended one gets Runner.Resume again.
+// reached the provider), unless the stop time has come;
+// - resuming: once the stop time has come the pending operation is
+// failed and the job takes the VM's state, with no provider call and no
+// commit (failResumeAtDeadline). Before it, a running VM commits the
+// pending operation (commitResume) and a suspended one gets
+// Runner.Resume again.
+//
+// While the job's age is unsettled after a restart (ageUnsettled, refreshOne's
+// untrusted test), only the not-found marker is cleared: refreshOne re-bases
+// the job's times from the provider's age, or stops it as elapsed_unknown,
+// right after the hook, and recovery waits for the next pass, so it is
+// judged against the settled stop time.
//
// Every live sighting clears notfound_since_t before the hook returns, so
// refreshOne's restart handling after it sees the cleared value. A provider
// call the hook makes that fails is audited and sent again next pass, not
// returned: only store errors are, so a failing re-send never holds up
-// refreshOne's restart handling.
-//
-// Unknown states never get here (refreshOne leaves them), so a pending
-// resume stays pending for the next pass; a terminal VM gets proof from
-// refreshOne, and its pending resume is marked failed by the next call that
-// touches the job (failDeadResume) or the reaper.
+// refreshOne's restart handling. Unknown states never get here, so a
+// pending resume stays pending for the next pass; a terminal VM gets proof
+// from refreshOne, which fails its pending resume in the same transaction
+// (writeProof).
func (c *Controller) mirrorLive(ctx context.Context, j jobRow, st isolatedjob.State) error {
if !pauseState(j.state) && !j.stopRequested.Valid {
return c.mirrorState(ctx, j.attempt, st)
@@ -375,9 +460,8 @@ func (c *Controller) mirrorLive(ctx context.Context, j jobRow, st isolatedjob.St
next = func() error { return c.mirrorState(ctx, p.attempt, st) }
return failDeadResume(ctx, tx, &p, now)
}
- if _, err := tx.ExecContext(ctx, `UPDATE jobs SET notfound_since_t = NULL, revision = revision + 1
- WHERE attempt_id = ? AND notfound_since_t IS NOT NULL`, p.attempt); err != nil {
- return fmt.Errorf("hostedctl: clear not-found of %s: %w", p.attempt, err)
+ if err := clearNotFound(ctx, tx, p.attempt); err != nil || c.ageUnsettled(&p) {
+ return err
}
a := Audit{Account: p.account, Task: p.task, Attempt: p.attempt, At: now}
switch {
@@ -390,7 +474,7 @@ func (c *Controller) mirrorLive(ctx context.Context, j jobRow, st isolatedjob.St
}
a.Action, a.Reason = actionSuspendSettled, fmt.Sprintf("generation %d: provider reports the VM suspended", p.generation)
return appendAudit(tx, a)
- case p.state == JobSuspending && st == isolatedjob.StateRunning:
+ case p.state == JobSuspending && st == isolatedjob.StateRunning && !pastStop(&p, now):
next = func() error {
_, aerr := c.sendSuspend(ctx, "", &p, actionSuspendResent) // a failed call is audited and sent again next pass
return aerr
@@ -406,6 +490,8 @@ func (c *Controller) mirrorLive(ctx context.Context, j jobRow, st isolatedjob.St
case !ok: // nothing to finish; the VM's own state is the best record
next = func() error { return c.mirrorState(ctx, p.attempt, st) }
return nil
+ case pastStop(&p, now):
+ return failResumeAtDeadline(ctx, tx, &p, now, st)
case st == isolatedjob.StateRunning:
return commitResume(ctx, tx, &p, op, "", now)
case st == isolatedjob.StateSuspended:
@@ -420,10 +506,15 @@ func (c *Controller) mirrorLive(ctx context.Context, j jobRow, st isolatedjob.St
}
// resendResume is Refresh sending the provider resume again for j's
-// pending op while the VM still reports suspended. The call's outcome is
-// audited; only a failure to write that row is returned. A failed call is
-// sent again on the next pass.
+// pending op while the VM still reports suspended. The stop time is checked
+// again just before the call; once it has come there is no call and the
+// next pass fails the operation. The call's outcome is audited; only a
+// failure to write that row is returned. A failed call is sent again on
+// the next pass.
func (c *Controller) resendResume(ctx context.Context, j *pauseJob, op resumeOp) error {
+ if pastStop(j, c.store.Clock().Now()) {
+ return nil
+ }
if perr := c.runner.Resume(ctx, isolatedjob.Ref(j.ref.String)); perr != nil {
return c.auditPause(ctx, "", j, actionResumeCallFailed,
fmt.Sprintf("refresh: operation %s: provider resume call failed; the operation stays pending", op.id))
diff --git a/internal/hostedctl/resume_test.go b/internal/hostedctl/resume_test.go
index d99189dc..f0d515c3 100644
--- a/internal/hostedctl/resume_test.go
+++ b/internal/hostedctl/resume_test.go
@@ -120,6 +120,7 @@ func (e *launchEnv) restart() {
}
func TestResumePreparesEpochBeforeProvider(t *testing.T) {
+ t.Parallel()
e := runningJob(t)
e.suspendJob()
type seen struct {
@@ -163,6 +164,7 @@ func TestResumePreparesEpochBeforeProvider(t *testing.T) {
}
func TestResumeCrashBeforeProvider(t *testing.T) {
+ t.Parallel()
e := runningJob(t)
e.suspendJob()
e.probe(&resumeProbe{before: func() error {
@@ -177,6 +179,8 @@ func TestResumeCrashBeforeProvider(t *testing.T) {
e.restart()
e.wantResume(JobResuming, 0, []opRow{pending("op-1", 1)}, 0)
+ e.refresh() // the first pass after the restart only re-bases the job's times
+ e.wantResume(JobResuming, 0, []opRow{pending("op-1", 1)}, 0)
e.refresh() // the VM is suspended: the resume is sent
e.wantResume(JobResuming, 0, []opRow{pending("op-1", 1)}, 1)
e.fake.Tick()
@@ -188,6 +192,7 @@ func TestResumeCrashBeforeProvider(t *testing.T) {
}
func TestResumeCrashAfterProvider(t *testing.T) {
+ t.Parallel()
e := runningJob(t)
e.suspendJob()
e.probe(&resumeProbe{after: func() {
@@ -202,6 +207,14 @@ func TestResumeCrashAfterProvider(t *testing.T) {
e.restart()
e.wantResume(JobResuming, 0, []opRow{pending("op-1", 1)}, 1)
+ // Until the first Refresh re-bases the job's times, a retry waits, and
+ // that Refresh drives no resume (the VM already runs: no commit yet).
+ if _, err := e.resume("op-1"); !errors.Is(err, ErrResumePending) {
+ t.Fatalf("Resume before the first refresh after a restart = %v, want ErrResumePending", err)
+ }
+ e.refresh()
+ e.wantResume(JobResuming, 0, []opRow{pending("op-1", 1)}, 1)
+
// The client retries: a no-op provider resume, then the commit.
e.resumeDone("op-1", 1)
e.wantResume(JobRunning, 1, []opRow{done("op-1", 1)}, 2)
@@ -214,6 +227,7 @@ func TestResumeCrashAfterProvider(t *testing.T) {
}
func TestResumeLostReply(t *testing.T) {
+ t.Parallel()
e := runningJob(t)
e.suspendJob()
e.fake.Inject(isolatedjob.OpResume, isolatedjob.FaultLostReply)
@@ -241,6 +255,7 @@ func TestResumeLostReply(t *testing.T) {
}
func TestResumeRetrySameOperation(t *testing.T) {
+ t.Parallel()
e := runningJob(t)
e.suspendJob()
for i := 0; i < 2; i++ {
@@ -262,6 +277,7 @@ func TestResumeRetrySameOperation(t *testing.T) {
}
func TestResumeOperationsRemembered(t *testing.T) {
+ t.Parallel()
e := runningJob(t)
e.suspendJob()
if _, err := e.resume("op-a"); !errors.Is(err, ErrResumePending) {
@@ -285,6 +301,7 @@ func TestResumeOperationsRemembered(t *testing.T) {
}
func TestResumeOtherOperationWhilePending(t *testing.T) {
+ t.Parallel()
e := runningJob(t)
e.suspendJob()
if _, err := e.resume("op-a"); !errors.Is(err, ErrResumePending) {
@@ -309,6 +326,7 @@ func TestResumeOtherOperationWhilePending(t *testing.T) {
}
func TestResumePastDeadlineRefused(t *testing.T) {
+ t.Parallel()
e := runningJob(t)
e.suspendJob()
stop := e.stopCols("att-1").stop
@@ -321,7 +339,8 @@ func TestResumePastDeadlineRefused(t *testing.T) {
t.Fatalf("audit = %+v, want resume_refused by inst-1", a)
}
- // A pending operation gets no further provider call past the stop time.
+ // A pending operation is failed past the stop time, with no further
+ // provider call; a retry of it is refused from then on.
e2 := runningJob(t)
e2.suspendJob()
e2.fake.Inject(isolatedjob.OpResume, isolatedjob.FaultThrottle)
@@ -333,5 +352,177 @@ func TestResumePastDeadlineRefused(t *testing.T) {
if _, err := e2.resume("op-1"); !errors.Is(err, ErrPastDeadline) {
t.Fatalf("retry of a pending Resume past the stop time = %v, want ErrPastDeadline", err)
}
- e2.wantResume(JobResuming, 0, []opRow{pending("op-1", 1)}, 1)
+ failed := opRow{id: "op-1", status: "failed", prepared: 1}
+ e2.wantResume(JobResuming, 0, []opRow{failed}, 1)
+ if _, err := e2.resume("op-1"); !errors.Is(err, isolatedjob.ErrConflict) {
+ t.Fatalf("retry of a failed operation = %v, want ErrConflict", err)
+ }
+ e2.wantResume(JobResuming, 0, []opRow{failed}, 1)
+
+ // Admission does not reopen past the stop time either.
+ e3 := runningJob(t)
+ g := e3.drain()
+ stop = e3.stopCols("att-1").stop
+ e3.clk.AdvanceMono(time.Duration(T(stop) - e3.store.Clock().Now()))
+ if err := e3.c.Reopen(e3.ctx, "inst-1", instKey, "att-1", g); !errors.Is(err, ErrPastDeadline) {
+ t.Fatalf("Reopen at the stop time = %v, want ErrPastDeadline", err)
+ }
+ if p := e3.pauseCols("att-1"); p.state != JobDraining {
+ t.Fatalf("after a refused Reopen the job is %q, want draining", p.state)
+ }
+}
+
+func TestResumeRefreshPastDeadline(t *testing.T) {
+ t.Parallel()
+ e := runningJob(t)
+ e.suspendJob()
+ e.fake.Inject(isolatedjob.OpResume, isolatedjob.FaultThrottle)
+ if _, err := e.resume("op-1"); !errors.Is(err, ErrResumePending) {
+ t.Fatalf("throttled Resume = %v, want ErrResumePending", err)
+ }
+ stop := e.stopCols("att-1").stop
+ e.clk.AdvanceMono(time.Duration(T(stop) - e.store.Clock().Now()))
+ e.refresh()
+ e.wantResume(JobSuspended, 0, []opRow{{id: "op-1", status: "failed", prepared: 1}}, 1)
+ e.fake.Tick()
+ e.refresh()
+ e.wantResume(JobSuspended, 0, []opRow{{id: "op-1", status: "failed", prepared: 1}}, 1)
+}
+
+func TestResumeRestartRebasesFirst(t *testing.T) {
+ t.Parallel()
+ e := runningJob(t)
+ e.suspendJob()
+ e.probe(&resumeProbe{after: func() {
+ e.fake.Tick() // the VM runs before the controller can commit
+ if err := e.store.Close(); err != nil {
+ t.Errorf("Close = %v", err)
+ }
+ }})
+ if _, err := e.resume("op-1"); err == nil {
+ t.Fatal("Resume across a crash = nil error")
+ }
+ // Down for 2 h with the wall clock stopped: the restored controller
+ // time knows nothing of it, the provider's age does.
+ e.clk.AdvanceMono(2 * time.Hour)
+ e.restart()
+ before := e.stopCols("att-1")
+
+ e.refresh() // re-base only: no commit against the stale stop time
+ e.wantResume(JobResuming, 0, []opRow{pending("op-1", 1)}, 1)
+ if after := e.stopCols("att-1"); after.stop >= before.stop || T(after.stop) > e.store.Clock().Now() {
+ t.Fatalf("stop time %d after the first refresh (was %d, now %d); want it re-based into the past",
+ after.stop, before.stop, e.store.Clock().Now())
+ }
+ e.refresh() // past the re-based stop time: the operation fails
+ e.wantResume(JobRunning, 0, []opRow{{id: "op-1", status: "failed", prepared: 1}}, 1)
+}
+
+func TestResumeDeadlineDuringProviderCall(t *testing.T) {
+ t.Parallel()
+ e := runningJob(t)
+ e.suspendJob()
+ e.probe(&resumeProbe{after: func() {
+ stop := e.stopCols("att-1").stop
+ e.clk.AdvanceMono(time.Duration(T(stop) - e.store.Clock().Now()))
+ e.fake.Tick() // the VM runs, but only once the stop time has come
+ }})
+ if ep, err := e.resume("op-1"); !errors.Is(err, ErrPastDeadline) || ep != 0 {
+ t.Fatalf("Resume whose provider call crossed the stop time = (%d, %v), want (0, ErrPastDeadline)", ep, err)
+ }
+ e.wantResume(JobRunning, 0, []opRow{{id: "op-1", status: "failed", prepared: 1}}, 1)
+}
+
+func TestResumeLiveReadClearsNotFound(t *testing.T) {
+ t.Parallel()
+ e := runningJob(t)
+ flaky := &notFoundOnce{Fake: e.fake}
+ e.run = flaky
+ e.newController()
+ e.suspendJob()
+ if _, err := e.resume("op-1"); !errors.Is(err, ErrResumePending) {
+ t.Fatalf("Resume = %v, want ErrResumePending", err)
+ }
+
+ flaky.n = 1 // a stale not-found
+ e.refresh()
+ if s := e.stopCols("att-1"); !s.notFoundSince.Valid {
+ t.Fatal("no first not-found recorded")
+ }
+ // The retry reads the VM live (still suspended): the not-found is void.
+ if _, err := e.resume("op-1"); !errors.Is(err, ErrResumePending) {
+ t.Fatalf("retry = %v, want ErrResumePending", err)
+ }
+ if s := e.stopCols("att-1"); s.notFoundSince.Valid || s.state != JobResuming {
+ t.Fatalf("after a live read: not-found since %v, state %q; want cleared, resuming", s.notFoundSince, s.state)
+ }
+ e.clk.AdvanceMono(NotFoundConfirm + time.Second)
+ flaky.n = 1 // another stale not-found
+ e.refresh()
+ if s := e.stopCols("att-1"); s.proof.Valid {
+ t.Fatalf("proof %s from two not-founds with a live read between them", s.proof.String)
+ }
+ e.audit() // a fresh passing network audit, so only the replacement rule can refuse
+ if err := e.replace("att-2", "att-1"); !errors.Is(err, ErrReplacementLive) {
+ t.Fatalf("replacement of att-1 = %v, want ErrReplacementLive", err)
+ }
+}
+
+// TestResumeFailedByProof: every way the job gets stop proof while a resume
+// is pending fails the operation with the proof, keeps its row, leaves the
+// epoch, and sends no further resume.
+func TestResumeFailedByProof(t *testing.T) {
+ t.Parallel()
+ for _, tc := range []struct {
+ name string
+ end func(t *testing.T, e *launchEnv, ref isolatedjob.Ref)
+ }{
+ {"the VM ends on its own", func(t *testing.T, e *launchEnv, ref isolatedjob.Ref) {
+ if err := e.fake.Stop(e.ctx, ref, "provider ended it"); err != nil {
+ t.Fatal(err)
+ }
+ e.fake.Tick()
+ e.refresh()
+ }},
+ {"the VM is gone, confirmed", func(t *testing.T, e *launchEnv, ref isolatedjob.Ref) {
+ e.fake.Vanish(ref)
+ e.refresh()
+ e.clk.AdvanceMono(NotFoundConfirm + time.Second)
+ e.refresh()
+ }},
+ {"the instance stops it", func(t *testing.T, e *launchEnv, ref isolatedjob.Ref) {
+ if _, err := e.c.Stop(e.ctx, "inst-1", instKey, "att-1", "task done"); !errors.Is(err, ErrStopPending) {
+ t.Fatalf("Stop = %v, want ErrStopPending", err)
+ }
+ e.fake.Tick()
+ if _, err := e.c.Stop(e.ctx, "inst-1", instKey, "att-1", "task done"); err != nil {
+ t.Fatalf("Stop once stopped = %v, want proof", err)
+ }
+ }},
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+ t.Parallel()
+ e := runningJob(t)
+ e.suspendJob()
+ e.fake.Inject(isolatedjob.OpResume, isolatedjob.FaultLostReply)
+ if _, err := e.resume("op-1"); !errors.Is(err, ErrResumePending) {
+ t.Fatalf("Resume with a lost reply = %v, want ErrResumePending", err)
+ }
+ v, err := e.c.Get(e.ctx, "inst-1", "att-1")
+ if err != nil {
+ t.Fatal(err)
+ }
+ tc.end(t, e, v.VMRef)
+ failed := []opRow{{id: "op-1", status: "failed", prepared: 1}}
+ e.wantResume(JobStopped, 0, failed, 1)
+ if !e.stopCols("att-1").proof.Valid {
+ t.Fatal("no stop proof")
+ }
+ e.refresh()
+ if _, err := e.resume("op-1"); !errors.Is(err, isolatedjob.ErrConflict) {
+ t.Fatalf("retry after proof = %v, want ErrConflict", err)
+ }
+ e.wantResume(JobStopped, 0, failed, 1)
+ })
+ }
}
diff --git a/internal/hostedctl/stop.go b/internal/hostedctl/stop.go
index 62291f0d..4e6908e8 100644
--- a/internal/hostedctl/stop.go
+++ b/internal/hostedctl/stop.go
@@ -425,8 +425,12 @@ func writeProof(ctx context.Context, tx *sql.Tx, actor hostedwire.KeyID, j jobRo
if ended {
why += "; no stop was asked for, so it ended on its own"
}
- return appendAudit(tx, Audit{Actor: actor, Account: j.account, Task: j.task, Attempt: j.attempt,
- Action: actionStopProven, Reason: why, At: p.ObservedAt})
+ if err := appendAudit(tx, Audit{Actor: actor, Account: j.account, Task: j.task, Attempt: j.attempt,
+ Action: actionStopProven, Reason: why, At: p.ObservedAt}); err != nil {
+ return err
+ }
+ // A resume still pending now never commits: fail it with the proof.
+ return failPendingResume(ctx, tx, j.account, j.task, j.attempt, p.ObservedAt, "stop proven before the pending resume committed")
}
// mirrorState saves a live VM state the provider reported as the job's