Repository navigation
Add tests for the time and auto save services - #167
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member
Author
|
Self-review rubric The anchors were
Notes and limits
Verdict: ready to merge. This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a unit-test expansion cycle (Stage B).
LocalTimeServiceandLocalAutoSaveServicehad no direct tests. Until nowLocalTimeServicewas only reached indirectly, throughElapseCommandTest, andLocalAutoSaveServicewas not reached at all. The new tests describe what the code does today. No production code is changed.LocalTimeServiceTest(5 tests) checks that eachelapseadds one time partition ofTIME_SLOT_LENGTH_IN_SECONDS * 1000ms and that repeated calls add up. It checks theTime elapsed. Number of elapsed slots: <n>log line, and that dead actors are removed while living ones are kept. It also checks thatrunreturns without elapsing when the application is not running.LocalAutoSaveServiceTest(2 tests) checks thatrunneither saves nor logs when the application is not running. The second test runs the real thread loop with a storage service that only counts saves. It saves once and logs the save message. An interrupted wait is logged asLocal Auto Save Service was interrupted.rather than ending the thread, and the loop stops once the running flag is cleared. The running flag is cleared beforeinterrupt(), so the thread sees the change when it detects the interrupt.Test plan
mvn clean test: 235 tests run, 0 failures, 0 errors (7 of them new)mvn surefire:test -Dtest=LocalTimeServiceTest,LocalAutoSaveServiceTest: 7 run, 7 passLocalAutoSaveServiceTestwas run three more times on its own and passed every time, with no flakiness seenIssues not picked this cycle
No tracking issue. The coverage gap was found during triage.
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson