Skip to content

tests: fix #3972, #3980 — verify the borrowed rig reload and the clearnet fixture apply - #3990

Closed
pithead-developer[bot] wants to merge 7 commits into
develop-v2.1.0from
agent/3972-e2e-borrow-never-moves-a-bench-s-own-roo
Closed

pithead-developer[bot] wants to merge 7 commits into
develop-v2.1.0from
agent/3972-e2e-borrow-never-moves-a-bench-s-own-roo

Conversation

@pithead-developer

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

Copy link
Copy Markdown
Contributor

What's the problem

Part of #3972
Part of #3980

How I fixed it

  • miner_reload (now in tests/integration/lib/borrow-fixture.sh, with wait_workers) tries restart, then sudo stop + start, then the user unit, and returns success only when that unit's MainPID changed. There is no signal fallback: a signal proves no reload, so a rig with no restartable unit fails loudly. After a stop, a failed start is retried once; if it still fails the reload fails (the rig stays stopped and the restore path reports it).
  • The borrowed pool always carries rig-id pithead-e2e, and wait_workers takes that name: it passes only when an online worker with that name is on the proxy, not on a bare count.
  • The clearnet fixture lives in tests/os/appliance-clearnet-fixture.sh (the node-runtime leg was at its file-budget ceiling). It waits for an idle control runner and a free mutation lock, runs the apply through approval_restore_step (exit status + redacted tail), retries once, and puts every attempt's diagnostic (exit status and redacted tail) in the failure row; a probe failure reads "busy or unreachable". Shortcut: "control runner answering" is checked as the path unit active and the service not activating, plus a free mutation lock; upgrade when the runner exposes a readiness probe.
  • Docs corrected in docs/dev/integration-testing.md and docs/dev/testing-strategy.md; budget ceilings lowered for the two files that shrank.
  • Shortcut: the reload proof is the MainPID change plus the named-worker gate, not the rig's XMRig API. Upgrade when the harness can reach that API.

Here is the proof

  • Ponytail pass: cut nothing the issues did not ask for; the one new file is a budget-forced split.
  • Selftests (local): selftest-borrow-reload.sh 12 passed (new file, split out to keep selftest-borrow-rearm.sh under 400 lines; it still passes, 46) (restart refused → stop/start accepted; same MainPID rejected; all paths failing is loud; no signal fallback; other/offline worker does not satisfy the gate; pre-existing bench pool gets the rig-id); appliance-node-runtime-leg.sh --self-test passed (busy-then-idle, never-idle, one retry then pass, two failures keep exit + the real filter's redacted tail, and an idle-wait failure on the retry keeps the first apply's diagnostic). The apply-output filter also keeps the lock-timeout phrase now.
  • Review on this head: the verifier found that develop's new four-attempt re-arm loop called wait_workers without the rig name, so that path still counted any worker. Fixed, with a behavioural test that drives handle_borrow_rearm and fails without the fix (every re-arm attempt waits for the borrowed rig by name). Added usage comments I had introduced were removed. Known limits kept: the borrow-time gate in e2e.sh stays a warning as before, and the matrix's own worker predicates still count proxy workers; a stop whose start fails twice leaves the rig stopped and fails the reload, and the exit restore retries it.
  • Checks on head c86210f (after merging develop-v2.1.0 again): make lint-file-budget passes with FILE_BUDGET_BASE_REF=origin/develop-v2.1.0 (the script defaults to origin/develop, which makes it flag three unrelated files on a PR that targets this line); make lint-pithead-build passed on the previous merged head; shfmt and shellcheck clean on the changed shell files; selftest-borrow-reload.sh 12 passed, selftest-borrow-rearm.sh 46 passed, appliance-node-runtime-leg.sh --self-test passed. GitHub: 52 checks pass, 2 skipped, none failing.
  • Bench jobs at the current head c86210f: tier4-e2e targeted completed (block below, unedited from bench-ci evidence); tier4-kvm provision job 3939 ended in error at the queue (environment: required shared node inputs/reservation unavailable after 17629s (sync_wait_seconds=14400); no image build started; every step skipped, no row ran), so it was resubmitted as a new attempt, job 3977, which completed (block below, unedited from bench-ci evidence).

bench-ci job 697@c86210f88515f251689a89387ee48d2ec1a55365 · pithead · tier4-kvm

bench-ci job 907@c86210f88515f251689a89387ee48d2ec1a55365 · pithead · tier4-e2e

  • options: {"mode": "targeted"}

  • status: completed · conclusion: failure · exit 1 · 30m 34s

  • baseline verified: yes · rig restored: yes

  • node guard: not recorded · no comparison recorded

  • steps: checkout success · reserve success · preflight success · run failure · collect success · restore success · cleanup success

  • rows: 156 pass · 1 fail · 3 skip (by-design 1, missing 2)

  • failed rows:

    • supplied rig exposes its enriched feed after control setup (no issue linked)
      Generated by bench-ci evidence 907@c86210f88515f251689a89387ee48d2ec1a55365; re-run it to check.

    In that job's raw log the borrow reads miner primary pool is now: <bench>:3333 then 1 worker(s) mining through the test bench (pithead-e2e), and the one red row is the rigforge-control setup: dashboard never re-reads the supplied rig within 120s after control setup (job 1698) #2890 row (worker '<rig>' never appeared), the same single failure as the four earlier e2e jobs. The fleet's downtime list has no interval on the bench that ran it during its window, so it is not an outage effect and was not resubmitted.

  • Bench evidence at the previous head 38ae5b6 (the base was merged and the re-arm gate fixed since), blocks pasted unedited from bench-ci evidence:

bench-ci job 599@38ae5b6ad808aba7419d51409aa3a9f659df0e0e · pithead · tier4-e2e

  • options: {"mode": "targeted"}
  • status: completed · conclusion: failure · exit 1 · 33m 05s
  • baseline verified: yes · rig restored: yes
  • node guard: not recorded · no comparison recorded
  • steps: checkout success · reserve success · preflight success · run failure · collect success · restore success · cleanup success
  • rows: 156 pass · 1 fail · 3 skip (by-design 1, missing 2)
  • failed rows:
    • supplied rig exposes its enriched feed after control setup (no issue linked)
      Generated by bench-ci evidence 599@38ae5b6ad808aba7419d51409aa3a9f659df0e0e; re-run it to check.

bench-ci job 521@38ae5b6ad808aba7419d51409aa3a9f659df0e0e · pithead · tier4-kvm

pithead-developer[bot] and others added 2 commits November 10, 2026 09:59
…rnet fixture apply

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nostics

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@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/in-progress stage/bench-testing its issue waits on a queued or running tier-4 bench job labels Nov 10, 2026
pithead-developer[bot] and others added 2 commits November 11, 2026 10:13
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…gnostic

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@pithead-developer pithead-developer Bot added stage/bench-testing its issue waits on a queued or running tier-4 bench job stage/needs-work returned by the reviewer, red CI, or conflicts with the base and removed stage/in-progress stage/bench-testing its issue waits on a queued or running tier-4 bench job labels Nov 11, 2026
@pithead-developer pithead-developer Bot added stage/in-progress and removed stage/needs-work returned by the reviewer, red CI, or conflicts with the base labels Nov 13, 2026
…-own-roo

Co-Authored-By: Claude Sonnet 5.5 <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 13, 2026
@pithead-developer pithead-developer Bot added this to the v2.0.5 milestone Nov 13, 2026
@pithead-developer pithead-developer Bot added stage/in-progress and removed stage/bench-testing its issue waits on a queued or running tier-4 bench job labels Nov 14, 2026
pithead-developer[bot] and others added 2 commits November 14, 2026 02:44
…d selftest

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@pithead-developer pithead-developer Bot added stage/bench-testing its issue waits on a queued or running tier-4 bench job stage/in-progress and removed stage/in-progress stage/bench-testing its issue waits on a queued or running tier-4 bench job labels Nov 14, 2026
@pithead-developer pithead-developer Bot added the stage/bench-testing its issue waits on a queued or running tier-4 bench job label Nov 14, 2026
@pithead-developer pithead-developer Bot added stage/in-progress stage/operator parked for the operator and removed stage/bench-testing its issue waits on a queued or running tier-4 bench job stage/in-progress labels Nov 14, 2026
@pithead-developer pithead-developer Bot modified the milestones: v2.0.5, v2.0.6 Nov 20, 2026
@pithead-developer pithead-developer Bot added stage/needs-review green or pending CI, no reviewer verdict on the head yet and removed stage/operator parked for the operator labels Nov 28, 2026
@pithead-developer

Copy link
Copy Markdown
Contributor Author

Replaced by #4621: the same five commits rebuilt on current develop, because this branch carried develop-v2.1.0 commits that develop lacks. This branch is left as it is.

@pithead-developer pithead-developer Bot added stage/needs-check and removed stage/needs-review green or pending CI, no reviewer verdict on the head yet labels Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants