Skip to content

Commit

Permalink
test(consensus_manager): fix flakiness in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tthebst committed Jan 23, 2024
1 parent c8be7bd commit b398704
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions rs/p2p/consensus_manager/src/receiver.rs
Expand Up @@ -725,7 +725,7 @@ mod tests {

use super::*;

const PROCESS_ARTIFACT_TIMEOUT: Duration = Duration::from_millis(100);
const PROCESS_ARTIFACT_TIMEOUT: Duration = Duration::from_millis(1000);

fn create_receive_manager(
log: ReplicaLogger,
Expand Down Expand Up @@ -1007,16 +1007,9 @@ mod tests {
assert_eq!(mgr.slot_table.len(), 1);
assert_eq!(mgr.slot_table.get(&NODE_1).unwrap().len(), 1);

let joined_artifact_processor = rt.block_on(async {
timeout(
PROCESS_ARTIFACT_TIMEOUT,
mgr.artifact_processor_tasks.join_next(),
)
.await
});
let joined_artifact_processor = rt.block_on(mgr.artifact_processor_tasks.join_next());

let result = joined_artifact_processor
.expect("Joining artifact processor join-set timed out")
.expect("Joining artifact processor task failed")
.expect("Artifact processor task panicked");

Expand Down Expand Up @@ -1542,16 +1535,9 @@ mod tests {
);

// Make sure the download task for 0 closes since both entries got overwritten.
let joined_artifact_processor = rt.block_on(async {
timeout(
PROCESS_ARTIFACT_TIMEOUT,
mgr.artifact_processor_tasks.join_next(),
)
.await
});
let joined_artifact_processor = rt.block_on(mgr.artifact_processor_tasks.join_next());

let result = joined_artifact_processor
.expect("Joining artifact processor join-set timed out")
.expect("Joining artifact processor task failed")
.expect("Artifact processor task panicked");

Expand Down

0 comments on commit b398704

Please sign in to comment.