Skip to content

Deflake async peer registration and harden PeerList.All#2999

Open
masih wants to merge 4 commits intomainfrom
masih/ractor-block-prov-deflake
Open

Deflake async peer registration and harden PeerList.All#2999
masih wants to merge 4 commits intomainfrom
masih/ractor-block-prov-deflake

Conversation

@masih
Copy link
Collaborator

@masih masih commented Mar 2, 2026

TestReactor_BlockProviders flakes because peer connectivity is established before the reactor has asynchronously processed peer-updates and appended all peers to r.peers.

Fix this categorically by:

  • waiting in reactorTestSuite.AddPeer until the new peer is visible in reactor.peers before returning;
  • making PeerList.All() return a copy (snapshot) instead of the internal slice;
  • adding TestPeerListAllReturnsSnapshot to enforce snapshot semantics.

This removes timing-sensitive reads of partially-registered peers and prevents callers from observing/mutating shared peer-list backing storage.

TestReactor_BlockProviders flakes because peer connectivity is
established before the reactor has asynchronously processed peer-updates
and appended all peers to r.peers.

Fix this categorically by:

* waiting in reactorTestSuite.AddPeer until the new peer is visible in
  reactor.peers before returning;
* making PeerList.All() return a copy (snapshot) instead of the internal
  slice;
* adding TestPeerListAllReturnsSnapshot to enforce snapshot semantics.

This removes timing-sensitive reads of partially-registered peers and
prevents callers from observing/mutating shared peer-list
backing storage.
@masih masih requested review from arajasek and pompon0 March 2, 2026 13:51
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMar 2, 2026, 3:34 PM

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.23%. Comparing base (b6685c1) to head (3613fd5).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2999   +/-   ##
=======================================
  Coverage   58.22%   58.23%           
=======================================
  Files        2113     2113           
  Lines      173528   173530    +2     
=======================================
+ Hits       101038   101051   +13     
+ Misses      63483    63474    -9     
+ Partials     9007     9005    -2     
Flag Coverage Δ
sei-chain-pr 73.16% <100.00%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-tendermint/internal/statesync/dispatcher.go 79.68% <100.00%> (+5.87%) ⬆️

... and 2 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.

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.

3 participants