Add content-based deduplication to the tests' shimmed P2P

The tests have recently had their timing stilted, causing failures. The tests
are... fine. They're fragile, as obvious, yet they're logical. The simplest fix
is to unstilt their timing rather to make them non-fragile.

The recent change, which presumably caused said stilting, was the the
rebroadcasting added. This de-duplication prevents most of the impact of
rebroadcasting. While there's still the async task, and the lock acquisition on
attempt to rebroadcast, this hopefully is enough.
This commit is contained in:
Luke Parker
2023-10-13 19:47:58 -04:00
parent d5c6ed1a03
commit 96c397caa0
2 changed files with 18 additions and 7 deletions

View File

@@ -70,7 +70,7 @@ async fn sync_test() {
// Now that we've confirmed the other tributaries formed a net without issue, drop the syncer's
// pending P2P messages
syncer_p2p.1.write().await.last_mut().unwrap().clear();
syncer_p2p.1.write().await.1.last_mut().unwrap().clear();
// Have it join the net
let syncer_key = Ristretto::generator() * *syncer_key;