Skip to content

Commit 3aed24a

Browse files
committed
test: fix flaky repo verify
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
1 parent e221e94 commit 3aed24a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/sharness/t0086-repo-verify.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,17 @@ check_random_corruption() {
2828

2929
test_expect_success "back up file and overwrite it" '
3030
cp "$to_break" backup_file &&
31-
echo "this is super broken" > "$to_break"
31+
echo "this is super broken" > "$to_break" &&
32+
sync "$to_break"
3233
'
3334

3435
test_expect_success "repo verify detects failure" '
3536
test_expect_code 1 ipfs repo verify
3637
'
3738

38-
test_expect_success "replace the object" '
39-
cp backup_file "$to_break"
39+
test_expect_success "restore broken object" '
40+
cp backup_file "$to_break" &&
41+
sync "$to_break"
4042
'
4143

4244
test_expect_success "ipfs repo verify passes just fine now" '

0 commit comments

Comments
 (0)