[Tarantool-patches] [PATCH 1/1] test: fix flaky qsync_basic.test.lua

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sat Jul 11 20:01:52 MSK 2020


In one of the test cases 2 fibers were started making a
transaction. In the first fiber the transaction was rolled back,
and the second fiber was expected to do the same.

It did rollback too, but not always immediately after the first
one. Because the first fiber needed not just do rollback right
away, but write a ROLLBACK entry into WAL before applying the
rollback to all next transactions. This led to a yield, during
which it was possible to observe the second fiber not dead yet.

The patch makes the test explicitly wait for the fibers death.

Closes #5162
---
Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-5162-flaky-qsync_basic
Issue: https://github.com/tarantool/tarantool/issues/5162

 test/replication/qsync_basic.result   | 8 ++++----
 test/replication/qsync_basic.test.lua | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/replication/qsync_basic.result b/test/replication/qsync_basic.result
index 6b55a0e5e..b355a5c06 100644
--- a/test/replication/qsync_basic.result
+++ b/test/replication/qsync_basic.result
@@ -382,13 +382,13 @@ end
  | ---
  | - error: A rollback for a synchronous transaction is received
  | ...
-f1:status()
+test_run:wait_cond(function() return f1:status() == 'dead' end)
  | ---
- | - dead
+ | - true
  | ...
-f2:status()
+test_run:wait_cond(function() return f2:status() == 'dead' end)
  | ---
- | - dead
+ | - true
  | ...
 box.space.sync:select{9}
  | ---
diff --git a/test/replication/qsync_basic.test.lua b/test/replication/qsync_basic.test.lua
index dcd1d6c76..205fb0664 100644
--- a/test/replication/qsync_basic.test.lua
+++ b/test/replication/qsync_basic.test.lua
@@ -153,8 +153,8 @@ do
     f2 = fiber.create(box.space.locallocal.replace, box.space.locallocal, {9})  \
     box.space.test:replace{9}                                                   \
 end
-f1:status()
-f2:status()
+test_run:wait_cond(function() return f1:status() == 'dead' end)
+test_run:wait_cond(function() return f2:status() == 'dead' end)
 box.space.sync:select{9}
 box.space.locallocal:select{9}
 box.space.test:select{9}
-- 
2.21.1 (Apple Git-122.3)



More information about the Tarantool-patches mailing list