Skip to content

fix(test): eliminate flakiness in BlockchainProcessorTests#10905

Open
LukaszRozmej wants to merge 1 commit intomasterfrom
fix/blockchain-processor-test-flakiness
Open

fix(test): eliminate flakiness in BlockchainProcessorTests#10905
LukaszRozmej wants to merge 1 commit intomasterfrom
fix/blockchain-processor-test-flakiness

Conversation

@LukaszRozmej
Copy link
Member

@LukaszRozmej LukaszRozmej commented Mar 20, 2026

Summary

  • Make block fields instance-scoped (not static) so parallel test instances don't share mutable Header.Author state mutated by RecoverData
  • Reduce mock Monitor.Wait re-check interval from 10s to 200ms (MockRecheckInterval) so the mock catches pre-populated signals faster
  • Remove [Retry(3)] from all three tests that had it

Test plan

  • All 18 BlockchainProcessorTests pass locally (2 consecutive runs)
  • CI passes without any retries on the previously flaky tests

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant