taskwarrior
taskwarrior copied to clipboard
TDB2 test cases fails nondeterministic
When running the tdb2.test.cpp test sometimes the test is failing as one can see in the below output.
On the test runs it fails in the second invocation, in the second test run it fails on the ninth invocation.
Similar can also be seen in this actions run where interestingly only one runner has this problem, whereas the others do run fine.
It came to me when updating to the #3446 runner, however it can be reproduced with the current develop using in the build/test directory.
for i in {1..14}
do
./tdb2.test.cpp
done
First Test Runs
❯ ctest --test-dir build-ninja --output-on-failure -R tdb2 --repeat-until-fail 10
Internal ctest changing into directory: /home/felix/data/taskwarrior/build-ninja
Test project /home/felix/data/taskwarrior/build-ninja
Start 7: tdb2.test.cpp
Test #7: tdb2.test.cpp .................... Passed 0.36 sec
Start 7: tdb2.test.cpp
Test #7: tdb2.test.cpp ....................***Failed 0.33 sec
1..12
ok 1 - TDB2 Read empty pending
ok 2 - TDB2 Read empty completed
ok 3 - TDB2 Read empty undo
ok 4 - TDB2 Read empty backlog
ok 5 - TDB2 after add, 1 pending task
ok 6 - TDB2 after add, 0 completed tasks
ok 7 - TDB2 after add, 1 revert possible
ok 8 - TDB2 after add, 6 local changes
ok 9 - TDB2 after set, 1 pending task
ok 10 - TDB2 after set, 0 completed tasks
ok 11 - TDB2 after set, 1 revert possible
not ok 12 - TDB2 after set, 7 local changes
# expected: 7
# got: 8
# 11 passed, 1 failed, 0 skipped. 91.7% passed.
0% tests passed, 1 tests failed out of 1
Total Test time (real) = 0.71 sec
The following tests FAILED:
7 - tdb2.test.cpp (Failed)
Errors while running CTest
Second Test Runs
❯ ctest --test-dir build-ninja --output-on-failure -R tdb2 --repeat-until-fail 10
Internal ctest changing into directory: /home/felix/data/taskwarrior/build-ninja
Test project /home/felix/data/taskwarrior/build-ninja
Start 7: tdb2.test.cpp
Test #7: tdb2.test.cpp .................... Passed 0.55 sec
Start 7: tdb2.test.cpp
Test #7: tdb2.test.cpp .................... Passed 0.26 sec
Start 7: tdb2.test.cpp
Test #7: tdb2.test.cpp .................... Passed 0.29 sec
Start 7: tdb2.test.cpp
Test #7: tdb2.test.cpp .................... Passed 0.30 sec
Start 7: tdb2.test.cpp
Test #7: tdb2.test.cpp .................... Passed 0.29 sec
Start 7: tdb2.test.cpp
Test #7: tdb2.test.cpp .................... Passed 0.28 sec
Start 7: tdb2.test.cpp
Test #7: tdb2.test.cpp .................... Passed 0.30 sec
Start 7: tdb2.test.cpp
Test #7: tdb2.test.cpp .................... Passed 0.30 sec
Start 7: tdb2.test.cpp
Test #7: tdb2.test.cpp ....................***Failed 0.31 sec
1..12
ok 1 - TDB2 Read empty pending
ok 2 - TDB2 Read empty completed
ok 3 - TDB2 Read empty undo
ok 4 - TDB2 Read empty backlog
ok 5 - TDB2 after add, 1 pending task
ok 6 - TDB2 after add, 0 completed tasks
ok 7 - TDB2 after add, 1 revert possible
ok 8 - TDB2 after add, 6 local changes
ok 9 - TDB2 after set, 1 pending task
ok 10 - TDB2 after set, 0 completed tasks
ok 11 - TDB2 after set, 1 revert possible
not ok 12 - TDB2 after set, 7 local changes
# expected: 7
# got: 8
# 11 passed, 1 failed, 0 skipped. 91.7% passed.
0% tests passed, 1 tests failed out of 1
Total Test time (real) = 2.93 sec
The following tests FAILED:
7 - tdb2.test.cpp (Failed)
Errors while running CTest
--repeat-until-fail is pretty cool!