Fix flaky PBTS tests by anchoring the proposal wait deadline to now - #4195
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
PR SummaryLow Risk Overview Before: After: The wait uses a fixed Reviewed by Cursor Bugbot for commit 7e7e78f. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
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.
TestTooFarInThePastProposal(and the rest of the PBTS harness tests) time out waiting for the height-5-pattern proposal under-raceon CI.observedValidatorProposerHeightwaited for that proposal withtime.Until(previousBlockTime.Add(ensureTimeout)), butpreviousBlockTimeis 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
ensureTimeoutmeasured from the moment the harness starts waiting, like every otherensure*helper, and the now-unusedpreviousBlockTimeparameter is dropped.Flaked in: https://github.com/sei-protocol/sei-chain/actions/runs/34989800080/job/104451193066?pr=4184