Skip to content

test(maintain): stop the closed-slot test depending on the wall clock - #4

Merged
yordis merged 1 commit into
mainfrom
yordis/test-deflake-maintain-slots
Sep 2, 2026
Merged

test(maintain): stop the closed-slot test depending on the wall clock#4
yordis merged 1 commit into
mainfrom
yordis/test-deflake-maintain-slots

Conversation

@yordis

@yordis yordis commented Sep 2, 2026

Copy link
Copy Markdown
Member
  • one_pass_settles_all_closed_empty_slots sampled the wall clock at four independent points and asserted relationships that only hold if every sample lands in the same phase of the hour. It failed for the first two minutes of any hour, and again whenever a pass straddled an hour boundary.
  • Two of the last four runs on main were red from this and the e2e race rather than from real breakage. CI that fails randomly trains everyone to ignore red, which is how an actual regression gets merged.
  • Verified by pinning the test clock 30s past an hourly fire: the old assertions fail there (left: 1, right: 2) and the new ones pass, so the change is confirmed against the real failure condition rather than against a lucky clock.

It read the clock at four independent points and asserted relationships
that only hold when every read lands in the same phase of the hour, so it
failed for the first two minutes of any hour and again whenever a pass
straddled an hour boundary. A red build nobody trusts is worse than no
build.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 9de52404-272f-4bd5-afb3-f67b3e5479f7

📥 Commits

Reviewing files that changed from the base of the PR and between 5dc0dc6 and 4041634.

📒 Files selected for processing (1)
  • crates/walgit-server/tests/maintain.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The maintenance test now counts both Missing and Pending slots before execution. It reuses the initial now timestamp when it replans and checks closed slots after execution.

Changes

Maintenance test timing

Layer / File(s) Summary
Align slot counting and timestamp verification
crates/walgit-server/tests/maintain.rs
The test includes Pending slots in the initial count. The post-pass re-plan and slot_closed check use the original timestamp.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 40416

This change stabilizes a time-sensitive integration test without altering production behavior, so no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: tobi

Poem

A rabbit checks each hourly row
Missing and pending now both show
One clock guides the settling run
No fresh tick can hide what’s done
The slots stand clear beneath the sun

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the test change and its purpose: removing dependence on the wall clock.
Description check ✅ Passed The description directly explains the intermittent test failure, the wall-clock cause, and the verification of the fix.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yordis/test-deflake-maintain-slots

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@yordis
yordis merged commit 61e177e into main Sep 2, 2026
5 checks passed
@yordis
yordis deleted the yordis/test-deflake-maintain-slots branch September 2, 2026 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant