fleetd #431: pin profileForSlot, isSlot, nameForSlot against a live reload #432

Merged
ltms merged 1 commits from worker/431-memberregistry-live-readers-cdbad2-10 into main 2026-09-10 08:24:27 +02:00
Member

Pure test work, no production change.

#424 made MemberRegistry.slots() re-read fleet: on every call. Only roleForSlot was pinned against a real reload; profileForSlot, isSlot and nameForSlot have the exact same live-read line and none was tested for it. Proved the gap by freezing each one at a time to a construction-time snapshot: the full suite (1535 tests) stayed green for all three.

Adds 4 tests to MemberRegistryLiveTest, each driving a real ConfigRef.reload() against a @TempDir config file (never two frozen registries compared in memory, which would test the constructor instead of the reload):

  • profileForSlotReflectsAProfileChangedByReload
  • isSlotStopsReportingASlotRemovedByReload / isSlotStartsReportingASlotAddedByReload (both directions)
  • nameForSlotReflectsANameChangedByReload

profileForSlot has no call site anywhere in src/main yet (grepped), so there is no spawn-lifecycle seam to drive the test through beyond the accessor itself — noted rather than invented.

Build: mvn clean install — Tests run: 1539, Failures: 0, Errors: 0, Skipped: 0, BUILD SUCCESS.

Mutation proof (freeze one method at a time to a field flattened once in the constructor, full suite run each time, restored before commit):

Mutation slots() readers Failing test(s)
control (unmutated) 5 none (66/66 green across MemberRegistryLiveTest/MemberRegistryTest/CallerResolverTest)
freeze profileForSlot (line 186→ frozen field) 5→4 profileForSlotReflectsAProfileChangedByReload only
freeze isSlot (line 214→ frozen field) 5→4 isSlotStopsReportingASlotRemovedByReload + isSlotStartsReportingASlotAddedByReload only
freeze nameForSlot (line 208→ frozen field) 5→4 nameForSlotReflectsANameChangedByReload only

Each mutation killed exactly its own new test and left the other two (and the rest of the suite) green.

Pure test work, no production change. #424 made `MemberRegistry.slots()` re-read `fleet:` on every call. Only `roleForSlot` was pinned against a real reload; `profileForSlot`, `isSlot` and `nameForSlot` have the exact same live-read line and none was tested for it. Proved the gap by freezing each one at a time to a construction-time snapshot: the full suite (1535 tests) stayed green for all three. Adds 4 tests to `MemberRegistryLiveTest`, each driving a real `ConfigRef.reload()` against a `@TempDir` config file (never two frozen registries compared in memory, which would test the constructor instead of the reload): - `profileForSlotReflectsAProfileChangedByReload` - `isSlotStopsReportingASlotRemovedByReload` / `isSlotStartsReportingASlotAddedByReload` (both directions) - `nameForSlotReflectsANameChangedByReload` `profileForSlot` has no call site anywhere in `src/main` yet (grepped), so there is no spawn-lifecycle seam to drive the test through beyond the accessor itself — noted rather than invented. **Build:** `mvn clean install` — `Tests run: 1539, Failures: 0, Errors: 0, Skipped: 0`, `BUILD SUCCESS`. **Mutation proof** (freeze one method at a time to a field flattened once in the constructor, full suite run each time, restored before commit): | Mutation | slots() readers | Failing test(s) | |---|---|---| | control (unmutated) | 5 | none (66/66 green across MemberRegistryLiveTest/MemberRegistryTest/CallerResolverTest) | | freeze `profileForSlot` (line 186→ frozen field) | 5→4 | `profileForSlotReflectsAProfileChangedByReload` only | | freeze `isSlot` (line 214→ frozen field) | 5→4 | `isSlotStopsReportingASlotRemovedByReload` + `isSlotStartsReportingASlotAddedByReload` only | | freeze `nameForSlot` (line 208→ frozen field) | 5→4 | `nameForSlotReflectsANameChangedByReload` only | Each mutation killed exactly its own new test and left the other two (and the rest of the suite) green.
agent added 1 commit 2026-09-10 08:07:29 +02:00
fleetd #431: pin profileForSlot, isSlot and nameForSlot against a live reload
CI / contract (pull_request) Successful in 49s
CI / build (pull_request) Successful in 2m7s
a196d34455
#424 made MemberRegistry.slots() re-read fleet: on every call, but only
roleForSlot was tested against a real reload. profileForSlot, isSlot and
nameForSlot all have the same live-read line and none was pinned — proved by
freezing each to a construction-time snapshot and watching the full suite
stay green.

Adds 4 tests to MemberRegistryLiveTest, each driving a real ConfigRef.reload()
against a @TempDir config file (never two frozen registries compared in
memory, which would test the constructor instead of the reload):
- profileForSlotReflectsAProfileChangedByReload
- isSlotStopsReportingASlotRemovedByReload / isSlotStartsReportingASlotAddedByReload
- nameForSlotReflectsANameChangedByReload

No production change. profileForSlot has no call site anywhere in src/main
yet, so there is no spawn-lifecycle seam to drive the test through beyond the
accessor itself.
ltms merged commit d1e7d71eee into main 2026-09-10 08:24:27 +02:00
Sign in to join this conversation.