Skip to content

Comments

Add extra assert in flaky couch_file test#4630

Merged
nickva merged 1 commit intomainfrom
try-to-fix-flaky-couch-file-test
Jun 1, 2023
Merged

Add extra assert in flaky couch_file test#4630
nickva merged 1 commit intomainfrom
try-to-fix-flaky-couch-file-test

Conversation

@nickva
Copy link
Contributor

@nickva nickva commented May 31, 2023

The deletion test is flaky sometimes:

[2023-05-31T19:44:32.096Z]     File delete tests
[2023-05-31T19:44:32.096Z]       enable_database_recovery = false, context = delete
[2023-05-31T19:44:32.096Z]         couch_file_tests:424: make_enable_recovery_test_case...ok
[2023-05-31T19:44:32.096Z]         couch_file_tests:425: make_enable_recovery_test_case...ok
[2023-05-31T19:44:32.096Z]         couch_file_tests:426: make_enable_recovery_test_case...ok
[2023-05-31T19:44:32.096Z]         couch_file_tests:427: make_enable_recovery_test_case...*failed*
[2023-05-31T19:44:32.096Z] in function couch_file_tests:'-make_enable_recovery_test_case/3-fun-8-'/2 (test/eunit/couch_file_tests.erl, line 427)
[2023-05-31T19:44:32.096Z] in call from eunit_test:run_testfun/1 (eunit_test.erl, line 71)
[2023-05-31T19:44:32.096Z] in call from eunit_proc:run_test/1 (eunit_proc.erl, line 531)
[2023-05-31T19:44:32.096Z] in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 356)
[2023-05-31T19:44:32.096Z] in call from eunit_proc:handle_test/2 (eunit_proc.erl, line 514)
[2023-05-31T19:44:32.096Z] in call from eunit_proc:tests_inorder/3 (eunit_proc.erl, line 456)
[2023-05-31T19:44:32.096Z] in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 346)
[2023-05-31T19:44:32.096Z] in call from eunit_proc:run_group/2 (eunit_proc.erl, line 570)
[2023-05-31T19:44:32.096Z] **error:{assertEqual,[{module,couch_file_tests},
[2023-05-31T19:44:32.096Z]               {line,427},
[2023-05-31T19:44:32.096Z]               {expression,"length ( DeletedFiles )"},
[2023-05-31T19:44:32.096Z]               {expected,1},
[2023-05-31T19:44:32.096Z]               {value,0}]}
[2023-05-31T19:44:32.096Z]   output:<<"">>

It seems the renamed files are not found in the $root/.delete directory, which is odd as renames are supposed to be atomic. Should we fsync dir entries themselves? We could also add a sleep, but on first attempt is to add and extra assert that file:name/2 actually returned an ok not some posix error.

The deletion test is flaky sometimes:

```
[2023-05-31T19:44:32.096Z]     File delete tests
[2023-05-31T19:44:32.096Z]       enable_database_recovery = false, context = delete
[2023-05-31T19:44:32.096Z]         couch_file_tests:424: make_enable_recovery_test_case...ok
[2023-05-31T19:44:32.096Z]         couch_file_tests:425: make_enable_recovery_test_case...ok
[2023-05-31T19:44:32.096Z]         couch_file_tests:426: make_enable_recovery_test_case...ok
[2023-05-31T19:44:32.096Z]         couch_file_tests:427: make_enable_recovery_test_case...*failed*
[2023-05-31T19:44:32.096Z] in function couch_file_tests:'-make_enable_recovery_test_case/3-fun-8-'/2 (test/eunit/couch_file_tests.erl, line 427)
[2023-05-31T19:44:32.096Z] in call from eunit_test:run_testfun/1 (eunit_test.erl, line 71)
[2023-05-31T19:44:32.096Z] in call from eunit_proc:run_test/1 (eunit_proc.erl, line 531)
[2023-05-31T19:44:32.096Z] in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 356)
[2023-05-31T19:44:32.096Z] in call from eunit_proc:handle_test/2 (eunit_proc.erl, line 514)
[2023-05-31T19:44:32.096Z] in call from eunit_proc:tests_inorder/3 (eunit_proc.erl, line 456)
[2023-05-31T19:44:32.096Z] in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 346)
[2023-05-31T19:44:32.096Z] in call from eunit_proc:run_group/2 (eunit_proc.erl, line 570)
[2023-05-31T19:44:32.096Z] **error:{assertEqual,[{module,couch_file_tests},
[2023-05-31T19:44:32.096Z]               {line,427},
[2023-05-31T19:44:32.096Z]               {expression,"length ( DeletedFiles )"},
[2023-05-31T19:44:32.096Z]               {expected,1},
[2023-05-31T19:44:32.096Z]               {value,0}]}
[2023-05-31T19:44:32.096Z]   output:<<"">>
```

It seems the renamed files are not found in the $root/.delete directory, which
is odd as renames are supposed to be atomic. Should we fsync dir entries
themselves? We could also add a sleep, but on first attempt is to add and extra
assert that file:name/2 actually returned an ok not some posix error.
@nickva nickva merged commit 0fa9a07 into main Jun 1, 2023
@nickva nickva deleted the try-to-fix-flaky-couch-file-test branch June 1, 2023 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants