From bc1e9e7ff8d2c3747a7dbc3b649930ac5bc6425d Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 28 Mar 2024 08:26:19 +0000 Subject: test: fix intermittent test failures caused by test proposals with the same timestamp listed in an inconsistant list order; by ensuring test proposals have a different timestamps --- tests/list.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/list.rs b/tests/list.rs index 8252448..61c2201 100644 --- a/tests/list.rs +++ b/tests/list.rs @@ -23,6 +23,7 @@ fn cli_tester_create_proposals() -> Result { Some((PROPOSAL_TITLE_1, "proposal a description")), None, )?; + std::thread::sleep(std::time::Duration::from_millis(1000)); cli_tester_create_proposal( &git_repo, FEATURE_BRANCH_NAME_2, @@ -30,6 +31,7 @@ fn cli_tester_create_proposals() -> Result { Some((PROPOSAL_TITLE_2, "proposal b description")), None, )?; + std::thread::sleep(std::time::Duration::from_millis(1000)); cli_tester_create_proposal( &git_repo, FEATURE_BRANCH_NAME_3, @@ -72,7 +74,7 @@ fn cli_tester_create_proposal( in_reply_to: Option, ) -> Result<()> { create_and_populate_branch(test_repo, branch_name, prefix, false)?; - + std::thread::sleep(std::time::Duration::from_millis(1000)); if let Some(in_reply_to) = in_reply_to { let mut p = CliTester::new_from_dir( &test_repo.dir, @@ -489,7 +491,7 @@ mod when_main_branch_is_uptodate { "checked out proposal as '{FEATURE_BRANCH_NAME_3}' branch\r\n" ))?; p.expect_end()?; - + println!("blablagothere"); for p in [51, 52, 53, 55, 56] { relay::shutdown_relay(8000 + p)?; } @@ -726,6 +728,7 @@ mod when_main_branch_is_uptodate { let cli_tester_handle = std::thread::spawn(move || -> Result<()> { let originating_repo = cli_tester_create_proposals()?; + std::thread::sleep(std::time::Duration::from_millis(1000)); cli_tester_create_proposal( &originating_repo, FEATURE_BRANCH_NAME_4, -- cgit v1.2.3