Repository navigation
test(state): make the early stop window test independent of clock resolution - #1706
Conversation
…olution The test shrank the window to 1ns and relied on the clock moving between the publication and the stop. On Windows the clock can read the same instant for both, which is inside any window, so the stop counted as early and the test failed. It now keeps the default window and moves the launch and publication back past it.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Set timestamps outside the window pkg/service/state/early_stop_test.go |
The test now backdates lastLaunchAt and activeMediaPublishedAt by twice the existing window after publishing media. |
Priority:
Estimated code review effort: 1 (Trivial) | ~3 minutes
Change: Other
Possibly related PRs
- ZaparooProject/zaparoo-core#1697: Adds early-stop behavior and the test that this change updates.
Merge Risk: 
Minimal · up to afc8e
-
The test-only timing adjustment presents no identified merge-blocking risk.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
TestEarlyStop_StopAfterTheWindowIsNotEarlyshrank the early stop window to 1ns and assumed the clock moves between the game being published and the stop. On a fast Windows runner it doesn't, so the stop counted as early and the test failed. It failed twice onmainat 3d095b3.The test now keeps the default 30-second window and moves the recorded launch and publish times back past it, so the result no longer depends on clock resolution or runner speed. Without the time shift the test fails, so it still checks the window.
Summary by CodeRabbit