fix(test): eliminate flakiness in BlockchainProcessorTests#10905
Open
LukaszRozmej wants to merge 1 commit intomasterfrom
Open
fix(test): eliminate flakiness in BlockchainProcessorTests#10905LukaszRozmej wants to merge 1 commit intomasterfrom
LukaszRozmej wants to merge 1 commit intomasterfrom
Conversation
Two root causes: 1. Block fields were static, shared across parallel test instances ([Parallelizable(ParallelScope.All)] + InstancePerTestCase). RecoverData mutates Header.Author on these shared objects, so one test's recovery could alter another test's timing non-deterministically. Fix: make block fields instance-scoped. 2. Mock Monitor.Wait used the same 10s timeout (ProcessingWait) as the test assertion WaitOne. If a pulse arrived in the brief window between re-acquiring the lock and the next Monitor.Wait, the mock would sit idle for the full 10s before re-checking — eating the entire assertion budget. Fix: introduce MockRecheckInterval (200ms) for the mock loops. Removed [Retry(3)] from the three tests that had it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
static) so parallel test instances don't share mutableHeader.Authorstate mutated byRecoverDataMonitor.Waitre-check interval from 10s to 200ms (MockRecheckInterval) so the mock catches pre-populated signals faster[Retry(3)]from all three tests that had itTest plan
BlockchainProcessorTestspass locally (2 consecutive runs)🤖 Generated with Claude Code