Skip to content

Conversation

@wolf31o2
Copy link
Member

@wolf31o2 wolf31o2 commented Dec 2, 2025

Summary by cubic

Increase sleep in TestSchedulerRunFailFunc from 50ms to 100ms to stabilize the fail-check timing. This reduces flakiness by giving the task enough time to trigger the run-fail callback, especially on slower CI.

Written for commit 22e9526. Summary will update automatically on new commits.

Summary by CodeRabbit

  • Tests
    • Updated test timing parameters to better validate execution dynamics.

Note: This release contains internal test improvements with no user-facing changes.

✏️ Tip: You can customize this high-level summary in your review settings.

@wolf31o2 wolf31o2 requested a review from a team as a code owner December 2, 2025 15:38
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 2, 2025

📝 Walkthrough

Walkthrough

This pull request modifies a test file in the timer component. Specifically, in TestSchedulerRunFailFunc, the sleep duration within the task function is increased from 50 milliseconds to 100 milliseconds. This adjustment affects the timing behavior of the test by extending the execution time of each scheduled run iteration. No functional logic changes are present, and no public APIs or exported entities are altered.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single test file modification with a straightforward parameter change
  • No logic alterations or structural changes
  • Isolated timing adjustment with clear intent
  • Minimal risk of introducing defects

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: increasing a sleep timer value in a test for failure checking in the ledger module.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test/moar-sleep

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
ledger/timer_test.go (1)

96-107: Longer task sleep should reduce flakiness and still satisfy the assertion

Bumping the inner time.Sleep in the task from 50ms to 100ms (with a 10ms tick and 3‑tick interval) keeps the task running across multiple scheduled executions, so the fail func should fire at least as often as before while the test still only sleeps 200ms overall. This aligns with the PR goal of making the fail‑path check more robust.

If this test remains flaky in slower or jittery environments, you could optionally derive the inner sleep from the tick/interval (e.g., a small multiple of 3 * 10 * time.Millisecond) to make the timing relationship explicit and easier to adjust later, but it's not required for correctness here.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 779f0e2 and 22e9526.

📒 Files selected for processing (1)
  • ledger/timer_test.go (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: go-test (1.24.x, macos-latest)
  • GitHub Check: go-test (1.25.x, macos-latest)
  • GitHub Check: go-test (1.24.x, windows-latest)
  • GitHub Check: go-test (1.25.x, windows-latest)
  • GitHub Check: nilaway
  • GitHub Check: lint
  • GitHub Check: Analyze (go)

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@wolf31o2 wolf31o2 merged commit 55d7153 into main Dec 2, 2025
15 checks passed
@wolf31o2 wolf31o2 deleted the test/moar-sleep branch December 2, 2025 16:58
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.

3 participants