Skip to content

test(consensus): stop the sustained-flood progress test failing on busy machines - #1626

Merged
lklimek merged 1 commit into
devfrom
fix/consensus-load-progress-flake
Nov 19, 2026
Merged

lklimek merged 1 commit into
devfrom
fix/consensus-load-progress-flake

Conversation

@Claudius-Maginificent

@Claudius-Maginificent Claudius-Maginificent commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

TL;DR

The test that checks a node still finishes a height while a vote flood is running failed randomly on busy machines. It was wrongly deciding that the flood "never loaded the node". It now checks directly that the flood made the node wait, so it no longer depends on how fast the CI machine happens to be.

Detailed discussion

Internal test-only change; no user-observable behavior changes.

Root cause. TestLoadHeightProgressUnderSustainedFlood proved the flood loaded the node by requiring that the charged verification work exceed 50% of what the wall-clock budget allowed over the height. Under CPU contention the flood goroutines get preempted and cannot spend the budget fast enough, so the precondition failed. A typical failure: "138" is not greater than "138.03". On dev it failed 12/20 under host load 15–19, and 15/20 with -race and GOMAXPROCS=1. Diagnostics also showed the utilization check could pass with zero token waits, so it did not prove contention in either direction.

Fix. The test keeps the real wall-clock budget, which this test exists for, and the original deadlines and rate. It now:

  • drains the budget after the flood is seeded, so setup time cannot refill the initial burst;
  • seeds every attacker lane before the height starts, with a maximum-cost precommit carrying a well-formed but invalid signature, followed by the usual prevote top-ups;
  • counts real token waits through a recording wrapper around the real clock (recordingBudgetClock), and requires at least one wait before the honest votes are sent. This replaces the >50% utilization check.

The upper bound (charged work ≤ budget allowance) is kept.

Testing.

Configuration Before After
-race, GOMAXPROCS=1 15/20 failed 0/20 failed
standard — 0/20 failed

Negative controls (no flood; unlimited budget) fail the contention assertion 3/3 each.

Limitation. The test proves the budget was contended before the honest votes, not that it stayed saturated for the whole height.

🤖 Co-authored by Claudius the Magnificent AI Agent

🤖 Generated with Claude Code

PR Hygiene · eacb520

  • Bots — thepastaclaw skipped after the window
  • Self-review — not asked of a bot author
  • Build green
  • Approvals
    • files with no dedicated owner (internal/consensus/load_harness_test.go, internal/consensus/load_progress_test.go) — approved by lklimek

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

Keep the wall-clock budget and seed every attacker lane before consensus.
Lead each lane with a maximum-cost precommit carrying a well-formed invalid
signature, then sustain the existing prevote flood. Count real token-wait
timers before honest votes instead of requiring wall-time utilization.
Preserve the rate, work ceiling, and progress deadlines.

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

Co-Authored-By: Codex (gpt-6-astra) <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 17, 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

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
  • 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.

Share

@thepastaclaw

Copy link
Copy Markdown

🕓 Review not started yet because this PR is a draft.

  • Request normal review — click when the PR is ready for review.
  • Request priority review — click to move this review to the front of the queue.

Commit eacb520. Normal review starts when eligible; priority review starts as soon as a slot is available.

@lklimek
lklimek marked this pull request as ready for review November 19, 2026 20:24
@lklimek
lklimek enabled auto-merge (squash) November 19, 2026 20:24
@github-actions

Copy link
Copy Markdown

Policy satisfied — this can merge.
Full checklist in the description.

@github-actions github-actions Bot added the bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. label Nov 19, 2026
@lklimek
lklimek merged commit 6399246 into dev Nov 19, 2026
22 checks passed
@lklimek
lklimek deleted the fix/consensus-load-progress-flake branch November 19, 2026 20:25
@github-actions github-actions Bot added this to the v2.0 milestone Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-review-skipped A required review bot did not report; it was skipped by the window or by a person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants