From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [217.69.128.39]) (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 D9A7C445325 for ; Thu, 16 Jul 2020 23:38:17 +0300 (MSK) From: Vladislav Shpilevoy Date: Thu, 16 Jul 2020 22:38:12 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 3/4] test: fix flaky qsync_snapshots.test.lua List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, avtikhon@tarantool.org There was a test case about master writing a transaction, replica stating snapshot, master writing rollback, and replica canceling the snapshot. Because its data was spoiled with rolled back data. Sometimes it could happen that the master started writing the transaction to WAL in a newly created fiber, then the test switched to replica, successfully created the snapshot, and only then the data from master was received. As a result, the following rollback didn't affect the already finished snapshot. The patch forces the replica wait for receipt of dirty data from master before starting the snapshot. Closes #5167 --- test/replication/qsync_snapshots.result | 4 ++++ test/replication/qsync_snapshots.test.lua | 1 + 2 files changed, 5 insertions(+) diff --git a/test/replication/qsync_snapshots.result b/test/replication/qsync_snapshots.result index 2a126087a..782ffd482 100644 --- a/test/replication/qsync_snapshots.result +++ b/test/replication/qsync_snapshots.result @@ -204,6 +204,10 @@ fiber = require('fiber') box.cfg{replication_synchro_timeout=1000} | --- | ... +test_run:wait_cond(function() return box.space.sync:count() == 1 end) + | --- + | - true + | ... ok, err = nil | --- | ... diff --git a/test/replication/qsync_snapshots.test.lua b/test/replication/qsync_snapshots.test.lua index 0db61da95..979f04d5f 100644 --- a/test/replication/qsync_snapshots.test.lua +++ b/test/replication/qsync_snapshots.test.lua @@ -97,6 +97,7 @@ end) test_run:switch('replica') fiber = require('fiber') box.cfg{replication_synchro_timeout=1000} +test_run:wait_cond(function() return box.space.sync:count() == 1 end) ok, err = nil f = fiber.create(function() ok, err = pcall(box.snapshot) end) -- 2.21.1 (Apple Git-122.3)