mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-10 20:07:04 +01:00
75/75 lines through run_all.sh at --min 100, exit 0, and
check_shell_coverage.sh passes with the allowlist line already deleted
so the pass cannot come from the exemption.
55 assertions over 23 cases: all five profile repairs plus test_thorium,
including every dry-run arm, the partial singleton-lock case, a corrupt
database and the sqlite3-absent path. The lib needed NO production
change -- it already takes every path from $THORIUM_CONFIG_DIR, so
pointing that one variable at the tmpdir confines it completely.
The gate's per-case timeout moves from the jail's 120s default to 600s.
That default is a hang-catcher, not a performance budget, and this suite
has outgrown it: 76s bare at 25 test files, 93s at 27, and kcov roughly
doubles it. The symptom was a lib FAILING the gate while measuring
perfectly -- bt_audio.sh printed "127/127 lines = 100.00%" and then
"warn: case timed out after 120s", which --fail-on-case-error turned
into a non-zero exit. bt_audio.sh and arch_cpu.sh both pass now.
The cost, recorded in the evidence: a genuine hang takes 10 minutes per
pass to surface instead of 2. test_thorium's `read -r -p` is exactly
that shape, so every case here feeds it stdin explicitly.
This also settles the quarantine in b2779059. Re-adding the arch_sysctl
cases still yields "kcov instrumented no lines" for bt_audio at a 600s
timeout with no timeout warning, so runtime was never that file's
problem and the quarantine stands for the reason its header gives.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
58 lines
4.0 KiB
JSON
58 lines
4.0 KiB
JSON
{
|
|
"intent": "Test thorium_repairs.sh to 100% line coverage, take it off the shell coverage allowlist, and raise the coverage gate's per-case timeout, which the growing suite had outgrown.",
|
|
"scope": [
|
|
"linux_configuration/scripts/single_use/fixes/lib/tests/thorium_harness.sh (new)",
|
|
"linux_configuration/scripts/single_use/fixes/lib/tests/test_thorium_repairs.sh and test_thorium_repairs_deep.sh (new)",
|
|
"meta/scripts/lib/shell_coverage_bar.sh (--timeout added to the gate's jail invocation)",
|
|
"meta/shell-coverage-allowlist.txt (one line removed)",
|
|
"Non-goal: thorium_repairs.sh itself, which needed NO production change -- it already takes every path from $THORIUM_CONFIG_DIR"
|
|
],
|
|
"changes": [
|
|
"Added thorium_harness.sh, the fourth family harness, supplying THORIUM_CONFIG_DIR plus the backup_if_exists/remove_if_exists helpers that live in the entry script fix_thorium.sh rather than in any lib",
|
|
"Added 55 assertions over 23 cases across both files: all five profile repairs plus test_thorium, including the dry-run arm of every function that has one",
|
|
"Raised the gate's per-case timeout from the jail's 120s default to 600s in shell_coverage_bar.sh, because the suite is now 93s bare and kcov instrumentation roughly doubles that",
|
|
"Removed thorium_repairs.sh from meta/shell-coverage-allowlist.txt, taking it from 89 to 88 entries"
|
|
],
|
|
"verification": [
|
|
{
|
|
"command": "shell_coverage_jail.sh --subject .../tests/run_all.sh --measure thorium_repairs.sh --min 100 --fail-on-case-error",
|
|
"result": "pass",
|
|
"evidence": "thorium_repairs.sh: 75/75 lines = 100.00%, exit 0."
|
|
},
|
|
{
|
|
"command": "bash meta/scripts/check_shell_coverage.sh .../thorium_repairs.sh, AFTER deleting its allowlist line",
|
|
"result": "pass",
|
|
"evidence": "'every checked shell library meets the coverage bar', EXIT 0. Checked after removal so the pass cannot be coming from the exemption."
|
|
},
|
|
{
|
|
"command": "bash meta/scripts/check_shell_coverage.sh .../bt_audio.sh .../arch_cpu.sh",
|
|
"result": "pass",
|
|
"evidence": "EXIT 0. Before the timeout fix bt_audio.sh FAILED the gate while measuring a clean 127/127 -- the jail printed the number and then 'warn: case timed out after 120s', and --fail-on-case-error turned that into a non-zero exit."
|
|
},
|
|
{
|
|
"command": "time bash linux_configuration/scripts/single_use/fixes/lib/tests/run_all.sh",
|
|
"result": "pass",
|
|
"evidence": "All fixes lib test files passed; 93s bare with the two new files (76s before them). That runtime against the 120s default is what the fix addresses."
|
|
},
|
|
{
|
|
"command": "shellcheck + shfmt on the harness, both test files and shell_coverage_bar.sh",
|
|
"result": "pass",
|
|
"evidence": "No findings, zero suppressions."
|
|
},
|
|
{
|
|
"command": "shell_coverage_jail.sh --timeout 600s --measure bt_audio.sh, with test_arch_sysctl.sh temporarily restored",
|
|
"result": "fail",
|
|
"evidence": "bt_audio.sh: 'kcov instrumented no lines', with NO timeout warning at 600s. This rules out runtime as the cause of that file's contagion and confirms the quarantine in b2779059 was correct for the reason its header states."
|
|
}
|
|
],
|
|
"risks": [
|
|
"A genuine hang now takes 10 minutes per pass to surface instead of 2. test_thorium's `read -r -p` is exactly that shape, which is why every case feeding it supplies stdin explicitly.",
|
|
"The gate's timeout is now the binding constraint on how large this suite can grow; at 93s bare it has roughly a 3x margin left.",
|
|
"test_thorium backgrounds a stub that sleeps 30s so the process is still alive when the lib's `kill -0` runs; a much slower machine could in principle race it."
|
|
],
|
|
"rollback": [
|
|
"git revert the commit, then re-add the thorium_repairs.sh line to meta/shell-coverage-allowlist.txt",
|
|
"Note the revert also restores the 120s gate timeout, which will make bt_audio.sh fail the gate again on this suite; re-run check_shell_coverage.sh on bt_audio.sh to confirm that is understood"
|
|
]
|
|
}
|