]> git.bitcoin.ninja Git - rust-lightning/commit
Correct `peer_handler::test_process_events_multithreaded` 2024-08-flaky-test
authorMatt Corallo <git@bluematt.me>
Mon, 19 Aug 2024 18:59:08 +0000 (18:59 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 19 Aug 2024 21:14:27 +0000 (21:14 +0000)
commite34519b31a14e968d0da03ff7e1f60565421f234
tree3ca02d5dc07257024d4af6b20768b1cc3d90ae76
parent05ed0db67f95b447c8fc05a89bf2dc77e4f11280
Correct `peer_handler::test_process_events_multithreaded`

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
lightning/src/ln/peer_handler.rs
lightning/src/util/test_utils.rs