fleetd #442: pin startup report calls #445
Reference in New Issue
Block a user
Delete Branch "worker/442-pin-startup-report-calls-ad9c1b-15"
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?
Implements #442 with FleetdStartupReportTest. It invokes real Fleetd.main using an @TempDir config. The config triggers all four reports, then fails bind validation before any socket or port side effect. I kept four separate calls because the requested test can pin all four without changing production code.
Mutation evidence (each call was absent before its run):
Restored full command: mvn -f /Users/dai.ha/LTMS/.bridged-worktrees/615687-15/fleetd/pom.xml clean install
[INFO] Tests run: 1573, Failures: 0, Errors: 0, Skipped: 0
[INFO] BUILD SUCCESS
Candidate only, not changed or tested: reportRequiredSecrets(cfg) appears to have the same unpinned startup-caller shape.
Merging. Credit where it belongs: the worker wrote this test. Its backend died mid-turn ("Our servers are currently overloaded") and its worktree was later reaped with the member, so it never reported back. But it had committed and pushed first, and
e702630carries the whole 80-line test. The evidence below is mine, not the worker's — the tree it tested no longer exists, so I re-ran everything against the tree that will actually be merged.How I verified it. I made a detached worktree at the pushed branch, merged current
origin/maininto it, and repeated the battery there.main: exit 0, 0 conflicts.Tests run: 1574, Failures: 0, Errors: 0, Skipped: 0,BUILD SUCCESS, 0 compile errors.Fleetd.main, each with the deletion proven applied (occurrence count driven to 0) and then restored:main()reportGitHostShape(cfg)mainReportsEveryStartupGapBeforeValidationAbortsreportMemberTrustModel(cfg)reportMemberCredentialsGap(cfg)reportExhaustedPatternGap(cfg)All four go red, so the test pins each call on its own, not just the group.
One change of mine on top (
b1f34c2): the test importedjava.util.Listand never used it — it only namesListAppender, which has its own import. An unused import is an IDE warning and this repo gates on warnings. After removing it:Tests run: 1, Failures: 0,BUILD SUCCESS, 0 compile errors, no warning on the file. Nothing else changed, so the four kills above still describe this exact test logic.Why the seam works. The fixture writes a config with a non-loopback
bind.host, socfg.validateAll()atFleetd.java:161throws beforemaincan open the herdr socket or bind a port. All four reports run above it (:131,:132,:137,:141), so their log lines are already in the appender when the throw arrives. The config lives in a@TempDir, so no real.claude.jsonor any other host file is touched.What was NOT covered before this. Each
report*method had its own unit test, but each was referenced by exactly one test file and none of them asserted thatmainstill calls it.validateAllis referenced by 4 test files; the reports had no such backstop. Deleting a call frommainwas a green-build change until now.