Skip to content

Fix flaky PBTS tests by anchoring the proposal wait deadline to now - #4195

Merged
masih merged 1 commit into
giga-1from
masih/1789550855-pbts-proposal-wait-deadline
Sep 16, 2026
Merged

masih merged 1 commit into
giga-1from
masih/1789550855-pbts-proposal-wait-deadline

Conversation

@masih

@masih masih commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

TestTooFarInThePastProposal (and the rest of the PBTS harness tests) time out waiting for the height-5-pattern proposal under -race on CI. observedValidatorProposerHeight waited for that proposal with time.Until(previousBlockTime.Add(ensureTimeout)), but previousBlockTime is a simulated block timestamp (firstBlockTime + height4ProposedBlockOffset, which several tests leave at zero), so the deadline is effectively "five seconds after the first block's timestamp" - a budget shared by every preceding height of the run rather than by this one step. Each height takes roughly half a second with the race detector on, so about 4.5 s of that budget is spent before the final height starts and any scheduler noise makes the remainder expire. In the failing run the first block was at 15:43:12.38 and the timeout fired at 15:43:17.41.

The wait now uses the same ensureTimeout measured from the moment the harness starts waiting, like every other ensure* helper, and the now-unused previousBlockTime parameter is dropped.

Flaked in: https://github.com/sei-protocol/sei-chain/actions/runs/34989800080/job/104451193066?pr=4184

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedSep 16, 2026, 9:31 AM

@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.52%. Comparing base (7e3ca24) to head (7e7e78f).
⚠️ Report is 5 commits behind head on giga-1.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           giga-1    #4195      +/-   ##
==========================================
- Coverage   65.55%   65.52%   -0.03%     
==========================================
  Files        2081     2076       -5     
  Lines      157460   157021     -439     
==========================================
- Hits       103222   102895     -327     
+ Misses      54097    53985     -112     
  Partials      141      141              
Flag Coverage Δ
sei-chain-pr 83.66% <ø> (?)
sei-db ?

Flags with carried forward coverage won't be shown. Click here to find out more.
see 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@masih
masih marked this pull request as ready for review September 16, 2026 09:41
@cursor

cursor Bot commented Sep 16, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only change to proposal wait timing in the PBTS harness; no production consensus behavior is modified.

Overview
Fixes flaky PBTS harness timeouts under -race on CI by changing how observedValidatorProposerHeight waits for the observed validator’s proposal.

Before: ensureProposalWithTimeout used time.Until(previousBlockTime.Add(ensureTimeout)), so the deadline was tied to a simulated prior block time (often firstBlockTime + height4ProposedBlockOffset). That budget was effectively shared across earlier heights in the run, so by height 5 little wall-clock time remained and the wait could expire spuriously.

After: The wait uses a fixed ensureTimeout from when the helper starts waiting—the same pattern as nextHeight and other ensure* helpers. The unused previousBlockTime parameter is removed from observedValidatorProposerHeight and all call sites (run, height5).

Reviewed by Cursor Bugbot for commit 7e7e78f. Bugbot is set up for automated code reviews on this repo. Configure here.

@seidroid seidroid Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Anchors the PBTS harness's proposal wait to ensureTimeout from the moment waiting starts instead of a simulated block timestamp, which correctly fixes a shared-budget flake and makes the call site consistent with every other ensure* helper. No test depends on the old (shorter) deadline expiring, and the removed parameter's inputs remain used elsewhere, so nothing is left dangling.

Findings: 0 blocking | 0 non-blocking | 0 posted inline

Blockers

  • None at the file/PR level.

Non-blocking

  • None at the file/PR level.

@masih
masih added this pull request to the merge queue Sep 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 16, 2026
@masih
masih added this pull request to the merge queue Sep 16, 2026
Merged via the queue into giga-1 with commit 57c2f82 Sep 16, 2026
76 of 78 checks passed
@masih
masih deleted the masih/1789550855-pbts-proposal-wait-deadline branch September 16, 2026 10:22
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