fleetd #431: pin profileForSlot, isSlot, nameForSlot against a live reload #432
Reference in New Issue
Block a user
Delete Branch "worker/431-memberregistry-live-readers-cdbad2-10"
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?
Pure test work, no production change.
#424 made
MemberRegistry.slots()re-readfleet:on every call. OnlyroleForSlotwas pinned against a real reload;profileForSlot,isSlotandnameForSlothave 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 realConfigRef.reload()against a@TempDirconfig file (never two frozen registries compared in memory, which would test the constructor instead of the reload):profileForSlotReflectsAProfileChangedByReloadisSlotStopsReportingASlotRemovedByReload/isSlotStartsReportingASlotAddedByReload(both directions)nameForSlotReflectsANameChangedByReloadprofileForSlothas no call site anywhere insrc/mainyet (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):
profileForSlot(line 186→ frozen field)profileForSlotReflectsAProfileChangedByReloadonlyisSlot(line 214→ frozen field)isSlotStopsReportingASlotRemovedByReload+isSlotStartsReportingASlotAddedByReloadonlynameForSlot(line 208→ frozen field)nameForSlotReflectsANameChangedByReloadonlyEach mutation killed exactly its own new test and left the other two (and the rest of the suite) green.