Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH 1/1] test: fix flaky qsync_basic.test.lua
@ 2020-07-11 17:01 Vladislav Shpilevoy
  2020-07-13  8:35 ` Cyrill Gorcunov
  2020-07-13  9:07 ` Kirill Yukhin
  0 siblings, 2 replies; 3+ messages in thread
From: Vladislav Shpilevoy @ 2020-07-11 17:01 UTC (permalink / raw)
  To: tarantool-patches, gorcunov

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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-13  9:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-11 17:01 [Tarantool-patches] [PATCH 1/1] test: fix flaky qsync_basic.test.lua Vladislav Shpilevoy
2020-07-13  8:35 ` Cyrill Gorcunov
2020-07-13  9:07 ` Kirill Yukhin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox