From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (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 93DFB445320 for ; Thu, 23 Jul 2020 02:57:05 +0300 (MSK) From: Vladislav Shpilevoy Date: Thu, 23 Jul 2020 01:57:01 +0200 Message-Id: <88ecc7da88a4795de6b66281ab96d6cc6a0f7cf4.1595462166.git.v.shpilevoy@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 1/2] test: fix flaky qsync_snapshots.test.lua again List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, avtikhon@tarantool.org One of the test cases started a sync transaction on master, switched to replica, and tried to do some actions assuming that the latest master data has arrived here. But in fact the replica could be far behind the master. It could still contain data from the previous test case. That led to a bug, when it looked like if the replica had some data committed on it, but not committed on master - this was just data from the previous test case. The issue is solved by flushing master's state to replica via making a successful sync transaction. Closes #5167 --- test/replication/qsync_snapshots.result | 8 +++++++- test/replication/qsync_snapshots.test.lua | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/replication/qsync_snapshots.result b/test/replication/qsync_snapshots.result index 782ffd482..cafdd63c8 100644 --- a/test/replication/qsync_snapshots.result +++ b/test/replication/qsync_snapshots.result @@ -176,8 +176,14 @@ _ = box.schema.space.create('sync', {is_sync=true, engine=engine}) _ = box.space.sync:create_index('pk') | --- | ... +-- Write something to flush the current master's state to replica. +_ = box.space.sync:insert{1} + | --- + | ... +_ = box.space.sync:delete{1} + | --- + | ... --- Testcase body. test_run:switch('default') | --- | - true diff --git a/test/replication/qsync_snapshots.test.lua b/test/replication/qsync_snapshots.test.lua index 979f04d5f..590610974 100644 --- a/test/replication/qsync_snapshots.test.lua +++ b/test/replication/qsync_snapshots.test.lua @@ -85,8 +85,10 @@ test_run:switch('default') box.cfg{replication_synchro_quorum=NUM_INSTANCES, replication_synchro_timeout=1000} _ = box.schema.space.create('sync', {is_sync=true, engine=engine}) _ = box.space.sync:create_index('pk') +-- Write something to flush the current master's state to replica. +_ = box.space.sync:insert{1} +_ = box.space.sync:delete{1} --- Testcase body. test_run:switch('default') box.cfg{replication_synchro_quorum=BROKEN_QUORUM} ok, err = nil -- 2.21.1 (Apple Git-122.3)