Skip to content

test(os): bound the miner fastpath receipt by the trial's journal cursor (#4386) - #4552

Draft
pithead-developer[bot] wants to merge 2 commits into
develop-v2.1.0from
agent/4386-flaky-rig-row-connected-rig-cannot-mask-
Draft

pithead-developer[bot] wants to merge 2 commits into
develop-v2.1.0from
agent/4386-flaky-rig-row-connected-rig-cannot-mask-

Conversation

@pithead-developer

@pithead-developer pithead-developer Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What's the problem

The rig row connected rig cannot mask local miner backup recovery (#3375) failed as pithead-t3375: verdict=fastpath-restart-missing cleanup=verified recovery_failure=no on rig job 4519@8dee1a4dc86140627575d43441590f2ed4eb530d while passing on 4517@85b9ba8edafb9641d417d2f866b2b4c81e94fc51 with no code change under test — the row's own receipt was the flake. miner_fastpath_receipt grepped pithead-miner-recovery.service's journal from --since @<backup-at>, but backup-at is written only after the dashboard backup call returns: a fastpath line the watchdog logged between the proxy recreation (which happens inside the backup) and that marker sat outside the window the receipt searched, so a restart that really happened could read as missing — and the verdict line carried nothing that distinguished a timing miss from a real defect.

How I fixed it

  • tests/os/appliance-miner-recovery-leg.sh: the backup-ready dispatch now also captures a journal cursor (journalctl -n 0 --show-cursor) before the backup request, and miner_fastpath_receipt searches from that cursor with --after-cursor= — a race-free window covering the whole trial — keeping the old marker window as fallback when no cursor was captured.
  • When the restart line is genuinely missing, the receipt prints the window it used, the backup marker, and the recovery unit's own restarting xmrig lines from the last 30 minutes, so the failure text alone tells a timing miss from a real defect.
  • tests/os/selftest-miner-recovery.sh: the cursor is captured by running the real backup-ready dispatch against a journalctl --show-cursor stub emitting journalctl's actual cursor-line shape, and a receipt section pins four behaviours — restart observed through the captured cursor, a restart recorded only before the cursor never credited to the trial, the marker fallback still honored, and the missing-restart diagnostics.
  • No assertion skipped or loosened: a missing fastpath line still fails the row; only the window it is searched in became the trial's true start, and the failure output grew.

Here is the proof

Pending: the rig-phase tier4-kvm run of this head; its bench-ci evidence block will be pasted here unedited when it lands. Nothing on this diff blocks it: Build image (dashboard) is red on every develop-v2.1.0-based head from the debian 13.7 libzstd1 CVE (#4537) — a fresh CI rerun on this head reproduced the identical finding at 2026-12-02T07:34Z even though #4537 is closed, because the fix (merged on develop) still sits in the open forward-merge #4603 that must land on develop-v2.1.0 first. When that merge is in, this branch takes base in, CI runs green, and the rig-phase submission follows.

  • The failure text records why the fastpath restart was judged missing, so a timing miss can be told from a real defect — fastpath_restart=missing window=... plus the recovery unit's restart lines, pinned in tests/os/selftest-miner-recovery.sh.
  • The row passes in 20 consecutive rig runs, OR the cause is shown to be a product defect and tracked as such — this PR removes the test-side false-miss mechanism; the remaining mechanism (backup's own miner restart races the fastpath observation, and a failed workers read consumes the recreation signal) is shown and tracked as Miner-recovery fastpath can lose the proxy-recreation signal: a failed workers read marks the new proxy seen, and backup restarts the local miner itself #4551. The 20-consecutive-runs streak needs many bench rig runs beyond this head's evidence; what this head proves is the row green with the race-free receipt.
  • No assertion is skipped or loosened — the fastpath line is still required; the selftest additionally proves a pre-cursor restart is never credited.

Part of #4386

🤖 Generated with Claude Code

The #3375 rig row judged the fastpath restart by grepping the recovery
unit's journal since a marker written after the backup call returned, so
a restart recorded between the proxy recreation and that marker stayed
invisible, and a red verdict carried no evidence of which case it was.
The receipt now searches from a journal cursor captured before the
backup request (marker window kept as fallback) and, when the restart is
missing, prints the window used and the recovery unit's own restart
lines so a timing miss can be told from a real defect.

Co-Authored-By: Claude Code <noreply@anthropic.com>
journalctl prints its cursor as "-- cursor: <cursor>", so the capture
pattern from the first commit never matched and every real trial would
have silently kept the marker window. The selftest now drives the
backup-ready capture through that exact shape and pins the cursor the
receipt later searches from.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@pithead-developer pithead-developer Bot added stage/bench-testing its issue waits on a queued or running tier-4 bench job and removed stage/in-progress labels Nov 27, 2026
@pithead-developer pithead-developer Bot added this to the v2.1.1 milestone Nov 27, 2026
@pithead-developer pithead-developer Bot added stage/in-progress stage/bench-testing its issue waits on a queued or running tier-4 bench job and removed stage/bench-testing its issue waits on a queued or running tier-4 bench job stage/in-progress labels Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stage/bench-testing its issue waits on a queued or running tier-4 bench job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants