Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@dev.tarantool.org, gorcunov@gmail.com
Subject: [Tarantool-patches] [PATCH 1/1] test: fix flaky qsync_basic.test.lua
Date: Sat, 11 Jul 2020 19:01:52 +0200	[thread overview]
Message-ID: <094d9d56fcd71a01cd3a9467e81a18fd8608a032.1594486881.git.v.shpilevoy@tarantool.org> (raw)

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)

             reply	other threads:[~2020-07-11 17:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-11 17:01 Vladislav Shpilevoy [this message]
2020-07-13  8:35 ` Cyrill Gorcunov
2020-07-13  9:07 ` Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=094d9d56fcd71a01cd3a9467e81a18fd8608a032.1594486881.git.v.shpilevoy@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/1] test: fix flaky qsync_basic.test.lua' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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