diff --git a/narwhal/primary/src/tests/block_waiter_tests.rs b/narwhal/primary/src/tests/block_waiter_tests.rs index d94886f215a88..77f3efd02508f 100644 --- a/narwhal/primary/src/tests/block_waiter_tests.rs +++ b/narwhal/primary/src/tests/block_waiter_tests.rs @@ -129,7 +129,7 @@ async fn test_successfully_retrieve_multiple_blocks() { let (_, certificate_store, _) = create_db_stores(); // AND the necessary keys - let (name, committee) = resolve_name_and_committee(13000); + let (name, committee) = resolve_name_and_committee(13001); let key = keys().pop().unwrap(); let mut block_ids = Vec::new(); @@ -265,7 +265,7 @@ async fn test_one_pending_request_for_block_at_time() { let (_, certificate_store, _) = create_db_stores(); // AND the necessary keys - let (name, committee) = resolve_name_and_committee(13000); + let (name, committee) = resolve_name_and_committee(13002); // AND store certificate let header = common::fixture_header_with_payload(2); @@ -333,7 +333,7 @@ async fn test_unlocking_pending_get_block_request_after_response() { let (_, certificate_store, _) = create_db_stores(); // AND the necessary keys - let (name, committee) = resolve_name_and_committee(13000); + let (name, committee) = resolve_name_and_committee(13003); // AND store certificate let header = common::fixture_header_with_payload(2); @@ -392,7 +392,7 @@ async fn test_batch_timeout() { let (_, certificate_store, _) = create_db_stores(); // AND the necessary keys - let (name, committee) = resolve_name_and_committee(13000); + let (name, committee) = resolve_name_and_committee(13004); // AND store certificate let header = common::fixture_header_with_payload(2); @@ -448,7 +448,7 @@ async fn test_batch_timeout() { async fn test_return_error_when_certificate_is_missing() { // GIVEN let (_, certificate_store, _) = create_db_stores(); - let (name, committee) = resolve_name_and_committee(13000); + let (name, committee) = resolve_name_and_committee(13005); // AND create a certificate but don't store it let certificate = Certificate::::default(); diff --git a/narwhal/primary/src/tests/common.rs b/narwhal/primary/src/tests/common.rs index f6ca84ceb2f6c..10460997ec766 100644 --- a/narwhal/primary/src/tests/common.rs +++ b/narwhal/primary/src/tests/common.rs @@ -309,7 +309,9 @@ pub fn create_db_stores() -> ( ) } -// helper method to get a name and a committee +// helper method to get a name and a committee. Special care should be given on +// the base_port parameter to not collide between tests. It is advisable to +// provide unique base_port numbers across the tests. pub fn resolve_name_and_committee( base_port: u16, ) -> (Ed25519PublicKey, Committee) {