lightningdevkit / rust-lightning

A highly modular Bitcoin Lightning library written in Rust. It's rust-lightning, not Rusty's Lightning!
Other
1.15k stars 363 forks source link

Correct `peer_handler::test_process_events_multithreaded` #3254

Closed TheBlueMatt closed 1 month ago

TheBlueMatt commented 1 month ago

This test was added some time ago in 0c034e9a82e4339fb32af9da63832ac2a64abb0b, but never made any sense. PeerManager::process_events will go around its loop as many times is required to ensure we've always processed all events which were pending prior to a process_events call, so having a test that checks that we never go around more than twice is obviously broken.

And, indeed, in CI this tests fails with some regularity.

Instead, the test here is changed to ensure that we detectably go around the loop again at least once.

Fixes #2385

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.23%. Comparing base (05ed0db) to head (e34519b). Report is 15 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3254 +/- ## ========================================== + Coverage 89.65% 90.23% +0.58% ========================================== Files 125 125 Lines 102546 105713 +3167 Branches 102546 105713 +3167 ========================================== + Hits 91936 95395 +3459 + Misses 7904 7727 -177 + Partials 2706 2591 -115 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

TheBlueMatt commented 1 month ago

Squash-pushed with only the spelling change.