upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests/list.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-03-28 08:26:19 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-03-28 11:56:12 +0000
commitbc1e9e7ff8d2c3747a7dbc3b649930ac5bc6425d (patch)
tree41b866a596a3cb4774a8b9f862391901722fdb1a /tests/list.rs
parent1fb20de563babeafbe55d3608f1211787aba6497 (diff)
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
Diffstat (limited to 'tests/list.rs')
-rw-r--r--tests/list.rs7
1 files changed, 5 insertions, 2 deletions
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<GitTestRepo> {
23 Some((PROPOSAL_TITLE_1, "proposal a description")), 23 Some((PROPOSAL_TITLE_1, "proposal a description")),
24 None, 24 None,
25 )?; 25 )?;
26 std::thread::sleep(std::time::Duration::from_millis(1000));
26 cli_tester_create_proposal( 27 cli_tester_create_proposal(
27 &git_repo, 28 &git_repo,
28 FEATURE_BRANCH_NAME_2, 29 FEATURE_BRANCH_NAME_2,
@@ -30,6 +31,7 @@ fn cli_tester_create_proposals() -> Result<GitTestRepo> {
30 Some((PROPOSAL_TITLE_2, "proposal b description")), 31 Some((PROPOSAL_TITLE_2, "proposal b description")),
31 None, 32 None,
32 )?; 33 )?;
34 std::thread::sleep(std::time::Duration::from_millis(1000));
33 cli_tester_create_proposal( 35 cli_tester_create_proposal(
34 &git_repo, 36 &git_repo,
35 FEATURE_BRANCH_NAME_3, 37 FEATURE_BRANCH_NAME_3,
@@ -72,7 +74,7 @@ fn cli_tester_create_proposal(
72 in_reply_to: Option<String>, 74 in_reply_to: Option<String>,
73) -> Result<()> { 75) -> Result<()> {
74 create_and_populate_branch(test_repo, branch_name, prefix, false)?; 76 create_and_populate_branch(test_repo, branch_name, prefix, false)?;
75 77 std::thread::sleep(std::time::Duration::from_millis(1000));
76 if let Some(in_reply_to) = in_reply_to { 78 if let Some(in_reply_to) = in_reply_to {
77 let mut p = CliTester::new_from_dir( 79 let mut p = CliTester::new_from_dir(
78 &test_repo.dir, 80 &test_repo.dir,
@@ -489,7 +491,7 @@ mod when_main_branch_is_uptodate {
489 "checked out proposal as '{FEATURE_BRANCH_NAME_3}' branch\r\n" 491 "checked out proposal as '{FEATURE_BRANCH_NAME_3}' branch\r\n"
490 ))?; 492 ))?;
491 p.expect_end()?; 493 p.expect_end()?;
492 494 println!("blablagothere");
493 for p in [51, 52, 53, 55, 56] { 495 for p in [51, 52, 53, 55, 56] {
494 relay::shutdown_relay(8000 + p)?; 496 relay::shutdown_relay(8000 + p)?;
495 } 497 }
@@ -726,6 +728,7 @@ mod when_main_branch_is_uptodate {
726 728
727 let cli_tester_handle = std::thread::spawn(move || -> Result<()> { 729 let cli_tester_handle = std::thread::spawn(move || -> Result<()> {
728 let originating_repo = cli_tester_create_proposals()?; 730 let originating_repo = cli_tester_create_proposals()?;
731 std::thread::sleep(std::time::Duration::from_millis(1000));
729 cli_tester_create_proposal( 732 cli_tester_create_proposal(
730 &originating_repo, 733 &originating_repo,
731 FEATURE_BRANCH_NAME_4, 734 FEATURE_BRANCH_NAME_4,