J439: load-only test flakes (shim terminal lease, rootless cleanup, text file busy, liveness doubt) #475
Open
opened 2026-11-09 13:03:56 +00:00 by kayg
·
6 comments
No Branch/Tag specified
main
j470b-server-mesh-rejoin
mesh-compat-382
j444b-d381-key-wins-flood
j461b-macos-utun-reader-thread
j475b-remove-host-motion
fix-reconnect-new-link
j481-d380
dev
j479-mesh-soak
fix/j476-host-facts
j475-motion-pill-split
j470-mac-node-join
root-upgrade-d376
j474-review-merge
latency-targets-120hz
nightly-suite-shards
gotatun-pin-j469
macos-utun-reader-thread
fix-flood-echo-stall
wip/j416
motion-fast-ease-out
mesh-addhost-j259
takeover-close-terminals-d368
kbd-instant-followups
fix-trust-key-double-click
nightly-suite-partial-report
appwin-icons-j207
rusqlite-slice1
swipe-content-first-d374
mesh-mtu-381
addhost-instant-open
glass-contrast-d365-mock
glass-contrast-d365
signout-followups-442
fix-startup-toast-red
research-gotatun-matrix-j317
themes-sync-j304
fix-load-flakes
fix-nix-zig-patch
fix-compute01-browser-baseline
ratchet-size-baseline-419
predict-auto-d130
revoke-coverage-d367
nightly-suite-queue-timeout
nightly-browser-suite
fix-rustsec-2026-0459
fonts-ioskeley-obel
log-retention-d375
fix-kbd-no-anim-427
fix-dev-red-specs-2
takeover-proof-305-j205
wip/j410-server-pump
ui-consistency-d372
fix-osc52-clipboard
libghostty-vt-1.0
forget-retired-host-d369
j404-merge-426
fix-setup-lock-race
fix-touch-select-426
revoke-access-report-ui
fix-predictive-echo-specs
fix-selinux-agent-exec
wip/j395-checkpoint2
wip/j395
j391-review-scratch
ui-consistency-j195-deferred-rebased
fix-rustc-paths-421
decisions-wording-341
fix-install-suite-red
fix-dev-rtt-specs
fix-pending-removal-align
fix-privileged-skip
fix-install-suite-404
review-j368
mesh-dns-j254
revoke-access-report-d356b
revoke-privilege-round5
fix-removal-confirm
review-j360
gotatun-rotation-367
deps-refresh-340
review-j354
review-J351
review-j350
addhost-takeover-d359
revoke-report-items-347
revoke-end-sessions-d362
review-j348
size-mesh-ssh-346
size-trim-337
revoke-access-diff-d356
j259-pre-rebase-b06c5a6
j305-ended-at-start-spec
addhost-sudo-consent
fix-layout-real-specs-411
fix-shell-open-411
fix-console-hosts-373
fix-shell-exit
fuzz-host-name-353
fix-host-details-410
macos-filter-j197
research-gotatun-tricks
revoke-p3-j216l
stale-state-pill
revoke-followups-j216k
revoke-progress-j216e
backup/macos01-20261106/lume/j197
backup/macos01-20261106/lume/appwin-icons-j207-stash0
backup/macos01-20261106/claude/stash-0
backup/macos01-20261106/claude/stash-1
backup/macos01-20261106/claude/J80-macos-s1
backup/macos01-20261106/claude/J80
backup/macos01-20261106/claude/J80-slice1-20261102
backup/macos01-20261106/claude/J16b-appwin-on-dev
backup/macos01-20261106/claude/appwin-launch-idle-146
backup/macos01-20261106/claude/J80-s1-run
wip/j259
trust-285-p3c
runtime-lock-j216f
mesh-ssh-p3-j175
tun-proof-p3b
trust-285-p3
terminal-polish-j271
tun-proof-p3
ssh-install-flakes-j216i
fuzz-fixes-j264
trust-285-a
trust-285-b
restart-oversized-fixture-j198
backup/macos01-20261106/lume/appwin-icons-j207
restart-bound-j216h
up-preflight-p3-j198
backup/macos01-20261106/lume/j251
up-preflight-j198
wip/up-preflight-j198-j245-p2
wip/up-preflight-j198-j245-p1
agent-fsync-offloop-j196
wip/up-preflight-j198-j245
settings-offscreen-j231
wip/up-preflight-j198-j226-inspection
wip/j103f
themes-j206
wip/up-preflight-j198-j226
flakes-j216c
backup/macos01-20261106/claude/j197
flakes-j216b
backup/macos01-20261106/claude/j197-red
wip/up-preflight-j198-review
flakes-j216
backup/macos01-20261106/claude/appwin-icons-j207
engineering-j208b
appwin-mock-j209
toast-stack-j165
engineering-j208
decisions-d351
decisions-d350
decisions-d349
appearance-presets-mock-j129
decisions-d348
docs-audit-spec
doc-coverage-baseline-raise
decisions-d347
decisions-d346b
decisions-d346
j88h-profile
ui-consistency-j195-deferred
ui-consistency-j195
engineering-practices-j194
preferred-login-ui-j166
signin-pools-263-j174
macos-node-265-s1
decisions-d345
decisions-d344
proxy-cgroup-j164
verify-quick-fuzz-329
proxy-start-io-j168
timing-flakes-j163
up-263-s1
mcp-events-j147
verify-quick-fuzz-j158
proxy-p3-j159
agent-resource-j157-detect
wip/j103d-final
remote-cancel-hang-j155
proxy-traefik-281-j62d
j149-verify-quick
proxy-traefik-281-j62b
j150-drop-unnamed
wip/j79d-red-r4
wip/j103d-d332
rootless-toast-j142
wip/j103d-head
wip/j103d
j125c-mcp
macos-build-j136
backup/macos01-20261106/claude/j136
wip/j79d-red-cli
wip/j79d-red-server
j121-link-liveness
j118c-tracer-failures
wip/j79c-head
release-desktop-j131
j124c-signed-macos
wip/j79c-red-p3
wip/j79c-red-p23
wip/j79c-red-p22
merge-j128-check
perf-deferred-j128
sidebar-toggle-260
j127-shortcut-changed-dot
j125-mcp
j118-tracer-failures
j126-account-summary
settings-sections-mock-j92
j120-pinch-lock
sidebar-292
backup/macos01-20261106/claude/j120
taste-2026-11-03
row-actions-242-215
backup/macos01-20261106/claude/stash-0-untracked
backup/macos01-20261106/claude/J80-265-s1-run
backup/macos01-20261106/claude/J80-macos-s1-20261102
j112-canvas-commands
ui-no-overshoot-scroll
fix-recovery-restart
backup/macos01-20261106/claude/stash-1-untracked
taste-2026-11-02
size-baseline-ratchet
machine-cards-structure-j108
j109-boot-copy-mockups
fix-dev-red
wip/up-263-s1
j95b-settings-rows
proxy-traefik-281
j95-option-rows
docs-human-j91
docs-keys-palette
fix-flood-1013-270-j38d
mesh-ssh-s1
mesh-ssh-s0
addhost-d291-tunnel
test-stability-load
mesh-relay-220
repro-296
shim-thp-off-24
mesh-pins-258-v2
mesh-dns
signin-d311-merged
docs-pages
ui-size-283
fix-ui-batch-specs
wip/j12b-edge-update
gate-on-arm
fix-rename-sync-293
trust-285-j60b
fix-focus-ring-clip
integ-ui-1101
edge-update-v2
signin-d311
taste-2026-11-01
layout-per-tab-250
ui-approved-splitopt-224
ui-approved-splitopt-224-on-dev
icon-text-centre-282
ui-approved-189-212-216
research-reverse-proxy
transfer-budget-320
review-mesh-pins-258-r2
sidebar-pill-259
review-mesh-relay-220
wip/j12-edge-update-v2
nix-package
status-crash-loop-237
fix-dev-test-failures
fix-fixture-socket-path
wip/mesh-relay-220-pre-dev-advance-rebase
fix-canvas-side-clip
research-head-to-head
frosted-real-256
review-mesh-pins-258
wip/mesh-relay-220-pre-final-rebase
review-layout-per-tab-250-r2
broad-suite-triage
nix-devshell
review-status-crash-loop-237-r3
wip/nix-devshell-pre-p3
taste-frosted-real
wip/code-serve-demo-2026-10-30
wip/code-serve-glass-2026-10-30
wip/code-serve-clusters-2026-10-30
wip/code-merge-release94-dev-2026-10-30
wip/rproxy-delta-scratch-2026-10-30
wip/stale-note-257-staged-2026-10-30
wip/d241-size-staged-2026-10-30
review-broad-suite-207
wip/mesh-pins-258-pre-split
wip/mesh-relay-220-pre-rebase
mesh-measure-220
plan-211-update
review-edge-autoupdate-r3
perf24-reconnect
review-stale-note-r2
release-prod-live
d241-shell-marker
review-mesh-pins-server-258
review-revocation-r3
review-setup-token-r2
review-sync-journal-r3
wip/review-mesh-pins-258-prune-review-1995fee46
frosted-scroll-256
sync-journal-r3
revocation-per-account-wip
review-tokio-asyncfd-0386
review-sync-p3s
wip/stash-8by64-stash0-2026-10-30
mesh-drag-r2
setup-token-data-wip
release-9-4
auth-busy-1013
mesh-view-overlap
sync-p3s
review-auth-busy-wake
review-readd-r8-wip
mesh-drag-bounds
audit-auth-93
app-windows-stream-start
review-authority-cap-r3
app-windows-r7-measure
readd-minimal-r6
readd-minimal-r5
app-windows-r7-soak
readd-minimal-r4
app-windows-r7
app-windows-r6
readd-minimal-r3
readd-minimal-r2
readd-minimal
merge-release8-dev
review-busy-page-liveness-r2
review-busy-page-liveness
mesh-view-trim
review-authority-read-retry-r2
review-remove-uninstall-r2
release-retry-reattach
release-retry
review-remove-uninstall
review-authority-read-retry
app-windows-ship
mesh-autoswitch-p2
mesh-ssh
mesh-relay
mesh-macos-node
screen-and-control
session-labels
review-real-logins-r5
review-real-logins-r4
review-real-logins-r3
shim-memory-r2
review-real-logins-r2
shim-memory
shadow-addhost-instant
shadow-real-logins
shadow-same-session-flood
shadow-prod-perf-fix
hosts-from-server
app-windows-real
app-windows-transport
release-prod-6w
mesh-policy-verify
quiet-close-toast
dev-merge-r4
review-mesh-agent-transport
review-app-windows-transport
settings-roundtrip
review-release-pipeline-r4
mesh-agent-transport
ended-strip-fix
review-audit-ca-update-d244
settings-rows
phone-width
signout-clear
fix-restart-tests
dev-merge-rp
signer-hardening
review-audit-ca-update
terminal-fidelity
review-audit-ca-update-wip
mesh-integrate
review-mesh-agent-transport-515d3712
review-mesh-dataplane-feec1988
mesh-dataplane
signout
research-canvas-node
wip/review-renderer-cost
wip/review-terminal-fidelity
padlock-glyph
review-release-pipeline-2e95b689
phone-polish
sidebar-polish
inbox-generic
review-mesh-dataplane-378d4055
prod-batch
ui-inbox
ui-ca-unlock
ui-machine-sections
review-mesh-dataplane-a5f744fb
tls-session-prod
session-bounds-prod
fix-dead-session
session-bounds
tls-session
palette-polish
shortcuts-d222
research-appmeta
phone-gutter
ui-centre-button
wip/ui-centre-button
wip/tls-session
review-addhost-breakit
ui-platform
renderer-cost
remote-agents
mesh-api
ssh-bootstrap
prod-hotfix2
prod-fixes
review-remote-agents
review-mesh-dataplane
session-life
research-browser
review-mesh-api
research-capture
review-mesh-api-round3
review-mesh-api-round1
gate-stability
review-gate-stability
review-relay-direct
review-mesh-api-findings
proto-sessions
font-picker
proto-addhost
proto-windows
mesh-core
latency-gate
research-bsd
research-discovery
keytray-mods
mock-core
ui-tweaks
fix-motion-sel
fix-motion
integrate2
fix-robust
t-web
t-server
vt-ghostty
fix-snap-echo
t-web-auth
review-vt2
t-agent
lane-protocol
lane-shim
lane-auth
s1-base
s1-contracts
s1-workspace
No results found.
No labels
launch-qa
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
kayg/infraternal#475
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Load-only flakes seen during
verify faston a busy compute01 (J411 evidence: compute01 ~/.cache/codex-scratch/j411/evidence/verify-fast.log):infraternal-shimlogin_lifecycle::unauthorized_controller_is_refused_before_terminal_acceptance: "worker retained a released terminal lease". Passed 5/5 alone.real_binary_rootless_cleanup_survives_sender_disconnect_before_readiness(resource_unavailable)login_binary::tests::cleanup_preserves_running_images_for_fallback_adoption("Text file busy")liveness_doubt...retires_the_link(timing)Plan: reproduce each in a loop under stress-ng/parallel-build load via build-slot, find the cause (timeout vs real product race vs test isolation), fix (product fix + deterministic test for real races; condition waits with generous bounds for timing), prove 50/50 under load. Branch
fix-load-flakesfrom origin/dev6df0f5bd5. Estimate: 3-4 h incl. queue (compute01 queue ~13 deep at start).Start: branch
fix-load-flakes, base6df0f5bd5e(origin/dev). First hypothesis for the shim case:Worker::retiredwaits 5 s but the worker idles out after a 3 s grace measured from its own start, so a worker starved for ~2 s fails the test. Not yet confirmed; reproducing under load first.Progress: harness queued on compute01 build-slot (queue ~14 deep, expect a long wait). Script
~/.cache/codex-scratch/j439/run.shbuilds the 4 test binaries and loops each 20x under 12 CPU spinners + 2 fsync writers (no stress-ng installed; box already at load avg ~45 on 16 vCPUs). Log:~/.cache/codex-scratch/j439/run1.log, evidence dir~/.cache/codex-scratch/j439/evidence/.Static findings so far (not yet reproduced):
Worker::retiredwaits 5 s; the worker idles out 3 s after its own startup. Unauthorized connections do not refresh that deadline, so failure needs the worker stalled >5 s past its deadline.login_binary.rstests (source()comment);cleanup_preserves_running_images_for_fallback_adoptionstill execsolddirectly afterstaged()in a multithreaded test process, so another test thread forking during the copy keeps ETXTBSY alive until its child execs.real_binary_rootless_person_revocation_stops_existing_shellshit a 1 schild.waittimeout inagent_fixture.py(same class).Findings so far (evidence on compute01 under
~/.cache/codex-scratch/; harness and logs for my runs on dev-02 under~/.cache/codex-scratch/j439/):Not reproducible with simple load. On dev-02 (10 cores), 20 serial loops and 24 parallel copies per test with 8-12 CPU spinners passed 100% for the agent, daemon and server tests. (My first shim loop also "passed", but only because the test is compiled behind the
host-loginfeature and--exactmatching nothing exits 0. Corrected below.) A whole-suite shim run (3 copies x 8 rounds, 8 spinners,--features host-login) had 0 failures and a worker retire latency of 3023-3027 ms, i.e. just the 3 s idle grace. Heavier run queued.1. shim
unauthorized_controller_is_refused_before_terminal_acceptance, "worker retained a released terminal lease" (j411/evidence/verify-fast.log:6341). The worker retires 3 s after startup (GRACE) andWorker::retiredwaits only 5 s, so the bound leaves 2 s of margin. Retirement also runsloginctl show-session(a D-Bus round trip) before exit. Every other wait in the file is also a fixed 5 s. No product race found: the worker's retirement logic is sound (no deadline refresh on unauthorised peers). Fix: oneWAITbound of 60 s for all conditions that return as soon as they hold.2.
login_binary::tests::cleanup_preserves_running_images_for_fallback_adoption, "Text file busy". Real mechanism, not a flake of the test's own logic:publishcopies the image through a writable descriptor; a sibling test thread that forks during the copy keeps that descriptor (CLOEXEC only acts at exec) until its child execs, and exec of the image fails with ETXTBSY for exactly that window. Same class inanonymous_kernel_image_can_be_published_after_unlink(appwin-launch-idle-146/evidence/verify-fast-text-file-busy.log),agent_sessions::detached_shim_is_discovered...(j60b). Fix:exec_when_not_busyretries only ETXTBSY; deterministic test holds a write descriptor, observes ETXTBSY, releases it inside the attempt. (Note for the orchestrator: production has the same window if the agent forks while publishing and systemd execs the image at that moment. Not changed here; rare, and the fix would live in systemd's exec.)3.
remote_runtime::...liveness_doubt::one_missed_primary_reply_shows_reconnecting_and_only_a_second_retires_the_link. Two failure modes in the logs:j395/evidence/fast4.log:4789-4793: "the link retired on its first miss: 366ms" (doubt_ms=222). The test measured from its ownanswer.store(false), but the product counts from the last reply it received; with probes delayed under load the last reply sits well before that instant. 222 ms < the 250 ms floor shows the reference is wrong, not the product.j51/evidence/verify-fast-ratcheted.log:2670-2673: "unexpected recovery notice Some(Reconnecting)": the test must answer inside a 250 ms window it does not control; when starved past 500 ms the link retires, correctly.Fix (test only): measure every bound from the fixture's own last-reply stamp (a strict bound on the server's clock) and treat a run in which the fixture was starved past the allowance as not-a-trial, repeating the scenario (max 6). A run that stayed inside the allowances and still misbehaves fails immediately.
4.
real_binary_rootless_cleanup_survives_sender_disconnect_before_readiness,resource_unavailable(j332/evidence/a-fast-final.log:1161-1173). The oracle's three real assertions had already passed (cleanup_byte_written,sender_disconnected,owned_shell_stoppedall true); the failure is its final cleanup callcontrol(..., 'terminal.login.revoke')returningresource_unavailable, which the agent maps from any non-InvalidInput io error out oflogins::revoke(daemon.rs~l.405-430). Investigating under heavier load to find which io error.Update (evidence on dev-02 under
~/.cache/codex-scratch/j439/; harness scripts there:run.sh,par.sh,suite.sh,y.sh,final.sh):Reproduced: #4
real_binary_rootless_cleanup_survives_sender_disconnect_before_readiness. 40 parallel copies x 4 rounds + 16 CPU spinners: 3 of 160 failed, same message as compute01 (control action result differs: resource_unavailableafter all three oracle checks were true). Files:evidence/daemon/FAIL-r1-c7.log,FAIL-r2-c23.log,FAIL-r2-c29.log, summary iny1.log. A temporary VM-only trace (never committed) of the io error behindresource_unavailableprintedCustom { kind: ConnectionReset, ... }three times out of three. Cause: the revoke'srootless_sessions::stopconnects to the shim's.stopsocket while the shim is still retiring from the earlier stop request (sender had disconnected) and the shim hangs up. A real product race: the person stays denied and the owner retries in the background, but the first caller gets a spurious refusal. Fix in product (stopaccepts the sealed exit record, which the shim writes before it exits, as proof after an attempt that ended because the shim left; no record = still refused), with two deterministic tests.Not reproduced (honest):
--features host-login: 0 failures, worker retire latency max 3117 ms (grace is 3000 ms). It takes a >5 s stall to hit the old bound; I could not produce one. The failure on compute01 is therefore inferred to be a host stall (it was at load ~45 on 16 vCPUs, a host that has OOMed this week). The fix (60 s condition bound) is justified by the 2 s margin, not by a reproduction.login_binary::module x 40 copies).Branch head now
64974e5c4(four atomic commits on current origin/dev). Final validation (new tests once + each flaky test x 120 under the same load) is queued;verify quick/verify fastfollow.Evidence for the flake hunt, from J407 (#447).
logins::tests::a_linger_request_landing_after_disable_never_survives_revocation:scripts/verify faston compute01, 2026-11-09 ~15:40 UTC, branchlatency-targets-120hzat174127529. That branch has no Rust changes, so the test binary is dev's at that time. Load average was 34–50 on 16 cores (the workspacecargo testrunning in parallel next to other jobs):Log:
compute01:~/.cache/codex-scratch/j407/fast.logaround line 2306. That target was deleted afterwards, but the log is kept.cargo test --locked -q -p infraternal-agent --lib logins::tests::a_linger_request_landing_after_disable_never_survives_revocationgavetest result: ok. 1 passed×3 (0.62–0.67 s).systemctlcall happens (3 instead of 2) before the revocation lands, so the race the test describes resolves the other way when the scheduler is slow. Either the assertion assumes an ordering the code doesn't guarantee, or the code issues a redundant call under load. I haven't traced which.5.
breakit2_concurrent_same_destination_issues_only_one_invitation(left: 2, right: 1): a test assumption, not a product race. Reproduced on dev-02 with the unmodified test (origin/dev5eb968744test code): 8 copies x 10 rounds + 16 CPU spinners, 13/80 and 9/80 failed (evidence/dest/old-1/FAIL-*.log,old-2/). A VM-only trace of the events (never committed) shows exactly two batches withhost_id: Someand stepFailed("Joining the host to this server failed", i.e. each issued an invitation and then hit the fixture's post-invitation refusal) and six refused with "This host is already being added" (host_id: None).Why that is not a double issue:
reserve_attemptchecks and inserts under oneattemptsmutex, so two attempts for one destination cannot be live together. The fixture makes the winner fail immediately;failed()fences its invitation synchronously (retire_failed) and then releases the reservation. A batch that was still in preflight/key preparation when that happened then reserves the freed destination and issues its own invitation, correctly. Guarantee = one live invitation per destination, which the test could not distinguish from one per run; load only widens the skew between batches. I looked for a window where the second reservation could succeed while the first invitation is still live (completion removes the attempt before retirement finishes,bootstrap_remote.rsfailed()/completed_record), but the invitation is already fenced by then and the durable check after reservation (existing_host(.., retire=true)) consumes or finds the old setup, so no live pair arises.Fix (test only, commit
33a15c4c9): the winner's invitation delivery waits on a gate that opens only after the other seven batches have finished with "already being added", so all eight overlap the winner's reservation whatever the scheduler does. Same load: 0/80, 0/80, and 0/120 at 40 copies (evidence/dest/new-*,new-heavy).