From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id C15BF445320 for ; Sat, 11 Jul 2020 20:01:53 +0300 (MSK) From: Vladislav Shpilevoy Date: Sat, 11 Jul 2020 19:01:52 +0200 Message-Id: <094d9d56fcd71a01cd3a9467e81a18fd8608a032.1594486881.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 1/1] test: fix flaky qsync_basic.test.lua List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, gorcunov@gmail.com 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)