Skip to content

test(consensus): freeze clocks in vote rate burst tests - #1454

Merged
lklimek merged 1 commit into
v1.8-devfrom
test/freeze-vote-rate-limit-clock
Sep 10, 2026
Merged

lklimek merged 1 commit into
v1.8-devfrom
test/freeze-vote-rate-limit-clock

Conversation

@lklimek

@lklimek lklimek commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Fix intermittent CI failures caused by vote-rate tests refilling their budgets while they run.

Issue being fixed or feature implemented

PR #1415 failed in tests (01): TestAllowVoteChannelMessage_ChargesVerificationCost admitted 8 maximum-cost precommits against an upper bound of 7. The unchanged test also exists on v1.8-dev; none of the other open PRs fixes it.

What was done?

Inject the existing fake clock into four tests that assume a fixed initial budget. Assert exact initial admission counts for prevotes and maximum-cost precommits. Production behavior is unchanged.

How Has This Been Tested?

  • Reproduced the failure with a temporary 200 ms pause in the admission loop: 9 precommits admitted against the old bound of 7.
  • With the fake clock, the same delayed experiment passes. The diagnostic pause is not included in this PR.
  • go test -mod=readonly -race -cover ./internal/consensus -run '^(TestAllowVoteChannelMessage_|TestVoteRateBurst)' -count=100 passes (Go 1.27.1).
  • golangci-lint v2.13.2 against the base revision, scoped to consensus: 0 issues.
  • gofmt and git diff --check pass.

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation (test-only change)

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Co-authored by Claudius the Magnificent AI Agent

Keep burst assertions independent of wall-clock refill under race instrumentation
or scheduler delays. Assert exact initial budgets for prevotes and precommits.

Co-Authored-By: Codex <[email protected]>

<sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>
@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: faa27123-f734-4a72-95b2-c055dd4e92d0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@lklimek
lklimek marked this pull request as ready for review September 10, 2026 10:17
@lklimek
lklimek merged commit 93e7030 into v1.8-dev Sep 10, 2026
18 checks passed
@lklimek
lklimek deleted the test/freeze-vote-rate-limit-clock branch September 10, 2026 10:17
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