Skip to content

Commit

Permalink
tests: attempt to fix a flaky test
Browse files Browse the repository at this point in the history
We saw a failure in `test_merge_views_git_heads()` in the GitHub CI,
but I wasn't able to reproduce it locally. Using the
`commit_transactions()` helper in the test should fix it.
  • Loading branch information
martinvonz committed Jul 16, 2023
1 parent 8149ec6 commit 8e7e327
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/tests/test_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,15 +449,13 @@ fn test_merge_views_git_heads() {
let tx1_head = write_random_commit(tx1.mut_repo(), &settings);
tx1.mut_repo()
.set_git_head_target(RefTarget::normal(tx1_head.id().clone()));
tx1.commit();

let mut tx2 = repo.start_transaction(&settings, "test");
let tx2_head = write_random_commit(tx2.mut_repo(), &settings);
tx2.mut_repo()
.set_git_head_target(RefTarget::normal(tx2_head.id().clone()));
tx2.commit();

let repo = repo.reload_at_head(&settings).unwrap();
let repo = commit_transactions(&settings, vec![tx1, tx2]);
let expected_git_head = RefTarget::from_legacy_form(
[tx0_head.id().clone()],
[tx1_head.id().clone(), tx2_head.id().clone()],
Expand Down

0 comments on commit 8e7e327

Please sign in to comment.