fleetd #426: pin FleetHealthMonitor.coverage and its HealthCoverageSource call site #542
Reference in New Issue
Block a user
Delete Branch "worker/426-health-coverage-ef1fd4-4"
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?
fleetd #426: FleetHealthMonitor.coverage had zero references in the test tree — not the method, not either output string, not the field it populates. Three independent mutations (inverting
enabled, swapping the two output strings, breaking the argument pairing at theHealthCoverageSourcecall site in Fleetd.java) all shipped a green build.What changed
HealthCoverageSourcelambda inFleetd.maininto a package-private static factoryFleetd.healthCoverageSource(ConfigRef)— same shape as the existingcapacitySource/quarantineSourcefactories, which exist for the identical argument-pairing risk (fleetd #415).FleetHealthMonitorCoverageTest— pins the three-branch method directly (the easy half).FleetdHealthCoverageSourceWiringTest— the half that matters: drives the extracted factory with a realFleetConfig.load+ConfigRefagainst@TempDirYAML fixtures (off / detection-only / full / absent health block), plus a hot-reload case provinghealth.notificationsstays live.Why extraction (a new seam) instead of #407's option 1
#407 (five log-only reporters) prefers keeping the config invalid and asserting on the log line emitted before
cfg.validateAll()throws — that adds no production code. That does not apply here: this call site is built duringFleetMcpconstruction, well aftervalidateAll()(~line 171) and afterUnixSocketHerdrClient.connecthas already opened a real herdr socket (~line 188). Reaching it via a realFleetd.mainrun would require real socket I/O, which this ticket's tests must not do. So the pairing is pinned by extraction instead, following the codebase's own established precedent for this exact defect shape.Output strings unchanged
"off"/"detection-only"/"full"are untouched —"detection-only"is what a live daemon'sfleet_listreports today.Verification
mvn clean install:Tests run: 1709, Failures: 0, Errors: 0, Skipped: 0,BUILD SUCCESS(baseline onf1640f5was 1701; +8 new tests: 5 wiring + 3 method-level).enabled): all 8 new tests fail. Killed."full"/"detection-only"): 5 of 8 fail (the 3off-only tests correctly stay green). Killed.HealthCoverageSourcecall site): 3 of 5 wiring tests fail — the 2 that pass do so because their fixtures use symmetric booleans (both true, or both false/null) where swapping coincidentally yields the same output; the mixed-boolean cases catch the real defect. Killed.shasum -a 256before/after equality plus cleangit status.Ticket: fleetd #426.