testsAndMisc/linux_configuration/scripts/single_use/fixes
Krzysztof kuhy Rudnicki 015eb48714
Some checks are pending
Pre-commit checks / pre-commit (push) Waiting to run
Shell tests / shell-tests (push) Waiting to run
Shell tests / arch-tests (push) Waiting to run
diagnose_pacman_hook_stall.sh: split 493 -> 249 + 6 libs, 100% coverage
Confirmed live (not dead code) via the dead-code check-in before any code
was touched -- the last two candidates this pattern was tried on were both
archived instead. Kept run_one/cleanup/log_size/main together in the entry
script: a prior session (2527fb3) already proved splitting run_one out
produces a real SC2153/SC2034 pair since PACMAN_PID/LAST_ELAPSED cross the
EXIT trap, not a suppressible false positive.

Fixed a real bug found while writing tests: print_summary's inline awk had
a dead `NR == 0` guard (printf on an empty array still emits one blank
line), reachable via `-n 0`. Refactored mem_available_mb, descendant_pids/
kill_tree, capture_stall's two output blocks, and print_summary's median
calc after confirming empirically (bash -x tracing) that kcov's
xtrace-based coverage can never see a `done <redirect>`, `} >redirect`, or
inline-awk line -- user chose to fix the code over the coverage tool.
descendant_pids specifically needed an explicit-fd process substitution
(not a pipe) to keep its array mutation in the current shell.

Made PACMAN_BIN/PACMAN_LOG/CACHE_DIR/PACMAN_LOCK/LOAD_FLOOR_MB/
LOAD_MIN_FREE_MB env-overridable for testing. Caught and fixed, before it
ran unbounded, a --with-load test that would have dd'd 13-20+ GB into
/dev/shm using this box's real available memory.

56 lib-level + 13 entry-level PATH-shim/subprocess assertions, 0 failed.
The entry test itself grew past 250 lines while adding coverage and had to
be split into a shared harness plus two test files, mid-session.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-18 22:33:57 +02:00
..
lib diagnose_pacman_hook_stall.sh: split 493 -> 249 + 6 libs, 100% coverage 2026-08-18 22:33:57 +02:00
diagnose_arch_performance.sh Split five more linux_configuration single_use scripts 2026-08-16 18:51:28 +02:00
diagnose_pacman_hook_stall.sh diagnose_pacman_hook_stall.sh: split 493 -> 249 + 6 libs, 100% coverage 2026-08-18 22:33:57 +02:00
fix_anki.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
fix_arch_performance.sh Split seven more linux_configuration scripts 2026-08-16 18:56:05 +02:00
fix_bluetooth.sh Split fix_bluetooth.sh 720 -> 186; defer steam_compatibility.sh 2026-08-16 19:17:05 +02:00
fix_controller.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
fix_flutter_git_env.sh Fix: stop the Flutter SDK reading your own repo as itself inside git hooks 2026-07-26 15:39:33 +02:00
fix_stepmania.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
fix_systemctl.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
fix_thorium.sh Split three more linux_configuration feature and fix scripts 2026-08-16 18:48:01 +02:00
fix_ubuntu_performance.sh Split three large linux_configuration scripts, defer a fourth 2026-08-16 19:06:16 +02:00
fix_virtualbox.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
fix_waifu2x.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
fix_yay_aur_database.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
migrate_hosts_guard_to_guard_lib.sh shell: split clean_audio, enforce_vbox_hosts and migrate_hosts_guard 2026-08-17 14:27:57 +02:00
nvidia_troubleshoot.sh fixes/utils: split nvidia_troubleshoot 336 -> 169+181, passwordless 374 -> 195+193 2026-08-17 14:18:06 +02:00
optimize_arch_desktop.sh Split offline docs and arch optimiser; defer libre_translate 2026-08-16 20:09:54 +02:00