Skip to content

Commit 7f8c549

Browse files
committed
test: fix flaky vinyl/deferred_delete test
The commit fixes the following test failure: ``` [019] vinyl/deferred_delete.test.lua [ fail ] [019] [019] Test failed! Result content mismatch: [019] --- vinyl/deferred_delete.result Tue Jan 11 11:10:22 2022 [019] +++ /build/usr/src/debug/tarantool-2.10.0~beta2.37.dev/test/var/rejects/vinyl/deferred_delete.reject Fri Jan 14 11:45:26 2022 [019] @@ -964,7 +964,7 @@ [019] ... [019] sk:stat().disk.dump.count -- 1 [019] --- [019] -- 1 [019] +- 0 [019] ... [019] sk:stat().rows - dummy_rows -- 120 old REPLACEs + 120 new REPLACEs + 120 deferred DELETEs [019] --- ``` The test checks that compaction of a primary index triggers dump of secondary indexes of the same space, because it generates deferred DELETE statements. There's no guarantee that by the time compaction completes, secondary index dump have been completed as well, because compaction may ignore the memory quota (it uses vy_quota_force_use in vy_deferred_delete_on_replace). Make the check more robust by using wait_cond. Follow-up #5089
1 parent 8c913a1 commit 7f8c549

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

test/vinyl/deferred_delete.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -965,9 +965,9 @@ test_run:wait_cond(function() return pk:stat().disk.compaction.count > 0 end)
965965
---
966966
- true
967967
...
968-
sk:stat().disk.dump.count -- 1
968+
test_run:wait_cond(function() return sk:stat().disk.dump.count > 0 end)
969969
---
970-
- 1
970+
- true
971971
...
972972
sk:stat().rows - dummy_rows -- 120 old REPLACEs + 120 new REPLACEs + 120 deferred DELETEs
973973
---

test/vinyl/deferred_delete.test.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,7 @@ box.stat.reset()
353353
-- of the secondary index.
354354
pk:compact()
355355
test_run:wait_cond(function() return pk:stat().disk.compaction.count > 0 end)
356-
357-
sk:stat().disk.dump.count -- 1
356+
test_run:wait_cond(function() return sk:stat().disk.dump.count > 0 end)
358357

359358
sk:stat().rows - dummy_rows -- 120 old REPLACEs + 120 new REPLACEs + 120 deferred DELETEs
360359

0 commit comments

Comments
 (0)