Skip to content

Commit

Permalink
test: fix flaky repo verify
Browse files Browse the repository at this point in the history
it seems verify not always notices file was broken, this fix performs
explicit flush and assumes CI uses filesystem with lazy flush or some
other unknown behavior
  • Loading branch information
lidel committed Mar 5, 2025
1 parent e221e94 commit 3aed24a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/sharness/t0086-repo-verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@ check_random_corruption() {

test_expect_success "back up file and overwrite it" '
cp "$to_break" backup_file &&
echo "this is super broken" > "$to_break"
echo "this is super broken" > "$to_break" &&
sync "$to_break"
'

test_expect_success "repo verify detects failure" '
test_expect_code 1 ipfs repo verify
'

test_expect_success "replace the object" '
cp backup_file "$to_break"
test_expect_success "restore broken object" '
cp backup_file "$to_break" &&
sync "$to_break"
'

test_expect_success "ipfs repo verify passes just fine now" '
Expand Down

0 comments on commit 3aed24a

Please sign in to comment.