fleetd #511: fix wrong --no-build wording in drain-gate abort, pin jar_id() default #514
Reference in New Issue
Block a user
Delete Branch "worker/511-9a4b23-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes fleetd #511.
1 — drain-gate abort message (decision a, cheap honest fix)
The message told the operator a rerun "with or without
--no-build" would finish the restart. That's wrong: by the time this message can fire,stage_built_jarhas already moved the jar off$JAR, so a rerun with--no-buildhitsrequire_no_build_jar's own refusal ("no jar at$JAR— run without--no-build").Before:
After:
Kept the staged path, the "daemon was NOT touched" fact, and the discard-by-hand option. Did not widen what
--no-buildmeans (that was option b, not taken).Added
test_drain_gate_abort_message_says_no_no_build, which reads the source (this code path is never reached by sourcing — the SOURCED guard stops before the main flow, same reasontest_swap_ordered_after_wait_and_before_startreads source instead of calling a function) and asserts the old wrong phrase is gone and the corrected wording + reason are present.2 — pin
jar_id()'s defaultAdded
test_jar_id_defaults_to_live_and_reports_explicit_path: setsJARandJAR_STAGEDto two files with different content, asserts a barejar_idreports the hash of$JAR, and assertsjar_id "$JAR_STAGED"reports the other hash. Both halves, per the ticket.Did not add a test for the
rm -f "$JAR_STAGED"leftover wipe at line 578 — the ticket documents it as an equivalent mutant (mvn clean installdeletestarget/on the next line regardless), so a test for it would only pin a line that can't change the outcome.Verification
bash -n scripts/redeploy-fleetd.shandbash -n scripts/test-redeploy-fleetd.sh: both pass.bash scripts/test-redeploy-fleetd.sh: exit 0, 35 test functions defined and invoked (up from 33), same 3 internalFAIL:lines from the suite's own mutation cells, finalPASS: redeploy log classifier.grep -nre-read, ran the suite (went red with the expectedFAIL:line, exit 1), restored from a saved copy, confirmed byte-identical withshasum -a 256, ran a green control (exit 0, same baseline shape).scripts/redeploy-fleetd.shagainst the live daemon; only sourced it inside the test suite as it already does.Out of scope, noted per the ticket, not fixed:
require_no_build_jar's own die message ("no jar at $JAR — run without --no-build") is itself an instance of the same "names a recovery" shape in miniature, but it's already correct and already pinned bytest_require_no_build_jar_dies_when_absent— no new instance found beyond what's in the ticket.