From 4a10ea4e3ee86b5b9ec6901ab76b73e2978f299a Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Fri, 4 Aug 2023 13:53:18 -0700 Subject: [PATCH] tests: attempt to fix more flaky tests in `test_view.rs` This is the same kind of fix as in 8e7e3271. I should have just fixed all instances then. --- lib/tests/test_view.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/tests/test_view.rs b/lib/tests/test_view.rs index a870a1d84..c1fbb08bc 100644 --- a/lib/tests/test_view.rs +++ b/lib/tests/test_view.rs @@ -350,15 +350,13 @@ fn test_merge_views_tags() { let v2_tx1 = write_random_commit(tx1.mut_repo(), &settings); tx1.mut_repo() .set_tag_target("v2.0", RefTarget::normal(v2_tx1.id().clone())); - tx1.commit(); let mut tx2 = repo.start_transaction(&settings, "test"); let v1_tx2 = write_random_commit(tx2.mut_repo(), &settings); tx2.mut_repo() .set_tag_target("v1.0", RefTarget::normal(v1_tx2.id().clone())); - tx2.commit(); - let repo = repo.reload_at_head(&settings).unwrap(); + let repo = commit_transactions(&settings, vec![tx1, tx2]); let expected_v1 = RefTarget::from_legacy_form( [v1_tx0.id().clone()], [v1_tx1.id().clone(), v1_tx2.id().clone()], @@ -406,7 +404,6 @@ fn test_merge_views_git_refs() { "refs/heads/feature", RefTarget::normal(feature_branch_tx1.id().clone()), ); - tx1.commit(); let mut tx2 = repo.start_transaction(&settings, "test"); let main_branch_tx2 = write_random_commit(tx2.mut_repo(), &settings); @@ -414,9 +411,8 @@ fn test_merge_views_git_refs() { "refs/heads/main", RefTarget::normal(main_branch_tx2.id().clone()), ); - tx2.commit(); - let repo = repo.reload_at_head(&settings).unwrap(); + let repo = commit_transactions(&settings, vec![tx1, tx2]); let expected_main_branch = RefTarget::from_legacy_form( [main_branch_tx0.id().clone()], [main_branch_tx1.id().clone(), main_branch_tx2.id().clone()],