Repository navigation
tools: cover a failed lane cleanup in the batch self-test - #717
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: The changes are confined to self-tests and cover lock isolation, startup termination, cleanup errors, and log truncation.
Checked
Cleanup: the new case injects status 70 after real lane cleanup and requires that status with no result output. By inspection, removing the propagation guard at tools/gate-batch.sh:1784 fails those assertions.
Lease: the fixture holds the earlier lock shared and uses a separate lock for the failed-write case at tools/ref/lease.sh:1248. A refused setup lock exits 70. The existing assertions require one named diagnostic, status 0, and an empty trace ID.
Startup: the fixture restores the short idle bound when an arm begins at tools/ref/load-groups.sh:280. The new silent-child case requires one timeout diagnostic, three arm records with status 143, and no remaining arm. Cleanup fixtures retain their status assertions.
Truncation: the missing command is checked in the full log. The fixed-log assertion at tools/gate-batch.sh:1989 requires exactly the first 200 characters. By inspection, a 201-character limit or inclusion of the second line fails it.
Structure and gates: no duplicate owner or unneeded abstraction identified. No production bands or pins move. No escape-catalog defect identified: the cleanup status is captured explicitly and the saved function alias avoids recursion.
Validation: bash -n passed separately for all three changed files.
Notes
Full runtime suites were not run during validation. The PR reports the full load-groups self-test and changed lease/batch case blocks; it does not report full lease or gate-batch suites on this head.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
셸 자체 시험 세 개가 잠금 파일 재사용, 시작 지연, 긴 임시 경로 때문에 실패하던 것을 고치고, 정리 실패 시험도 하나 더합니다.
Part of #565. Tracked in #699.
What and why
Three shell self-tests fail on main for reasons that have nothing to do with the code they check. Each one assumes something about its environment that the test does not set up. A fourth change adds the lane-cleanup error case that an earlier bot review asked for.
tools/ref/lease.sh: the trace write-failure case reuses the lock filetlock3. The slow-fork case before it can still hold a shared lock on that file, so the case's exclusiveflock -nis refused and the write-failure check never runs. The case returns 1 where it expects 0. This came in withdf872d5f6c53.tools/ref/load-groups.sh:stall_casestarts its idle bound before the child process has printed its first arm line. A child that starts slowly is killed before it begins, so the case reportsleft=where it expectsleft=1 2. This came in withcd5bd6659263(tools: load-groups.sh kills a process that prints nothing for BOUND seconds #169). Two cleanup fixtures in the same function make the same assumption.tools/gate-batch.sh: the missing-hook case expects the one-line summary to end with the missing command's name. The summary keeps only the first 200 characters of the log line, and under a longTMPDIRthe path pushes the name past that limit. This came in withbae2648b1d55.Changes:
tools/ref/lease.sh: the write-failure case takes its own lock file,tlock5. Before it runs, the test holds a shared lock ontlock3on descriptor 8, so going back to the shared name brings the defect back, and the setup exits at once if that shared lock cannot be taken.tools/ref/load-groups.sh:lg_prenow starts the short idle bound, so the bound runs from the first arm line and the outerlg_processcall gets a ten times longer budget for startup. The child sleeps one second longer than the idle bound before it prints its arm line. A new case runs a child that prints nothing, and checks that it is killed once, that all three arms end with the termination status 143 and that no arm is left. The two cleanup fixtures use the same budget. The driver's own pre-start timeout is unchanged.tools/gate-batch.sh: the missing-hook case reads the command name from the full hook log and checks only the status 127 on the summary line. A separate case writes a 250-character first line and a second line to a fixed log, and checks that the summary holds exactly the first 200 characters. The result no longer depends on how long the temporary path is.tools/gate-batch.sh:lskip_caseruns the realstop_lanesand then injects the status 70. The new case checks that the error is returned and that no result line is printed. This covers the cleanup failure case that the review of tools: wait for stopped batch fixture writers before cleanup #338 listed as non-blocking.No product code, public API, GPU path, gate band or pin changes. Only the self-test blocks in three shell files change.
Release notes: internal: three shell self-tests no longer depend on lock-file reuse, process start time or the length of the temporary path.
Code shape
lg_pre,check,wantandstop_lanes. No new function or helper was added.stop_lanesthat errors returns its error.cargo fmtandcargo clippydo not apply to shell files.bash -nandgit diff --checkare clean on the three files.Duplication found or removed (
path:line): none.Closes deferred:
tools/gate-batch.sh#338 bot review (non-blocking).What I ran
The three original self-tests fail on the unchanged files, each on the assumption described above. The run used a copy of the base checkout on a Linux host with a long
TMPDIR:On this branch, the same cases run on a DGX Spark (Linux aarch64), again with a long
TMPDIRmade of three 70-character directory levels:The lane-cleanup mutant removes the
|| return $?guard, so the injected rc 70 becomes 0 and the new assertion fails with rc 1, as expected. Theself-test: ok (0 failures)line is the nativeload-groups.sh --self-test, which ran in full.Not run: the full
lease.sh --self-testand the fullgate-batch.shself-test on this head. I ran the changed case blocks only. A first attempt to run the whole lease self-test was cut off before it finished, so I do not count it. Also not run: any Rust test, clippy, GPU test or speed comparison, because no product code changed.Reproduce, from the repository root:
Hardware
The base run was on a Linux host. The branch run was on a DGX Spark (Linux aarch64). These tests run shell on the CPU only and use no GPU or model files.
What I ran into
This does not block the PR. Two of the three introducing commits have no pull request on GitHub, so the Low entries in #699 name the commit only.
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.