Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@dev.tarantool.org, avtikhon@tarantool.org
Subject: [Tarantool-patches] [PATCH 3/4] test: fix flaky qsync_snapshots.test.lua
Date: Thu, 16 Jul 2020 22:38:12 +0200	[thread overview]
Message-ID: <daa9ad2137d37dec3241b2374ea3dc4cde6d961f.1594931843.git.v.shpilevoy@tarantool.org> (raw)
In-Reply-To: <cover.1594931843.git.v.shpilevoy@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)

  parent reply	other threads:[~2020-07-16 20:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 20:38 [Tarantool-patches] [PATCH 0/4] Flaky qsync tests Vladislav Shpilevoy
2020-07-16 20:38 ` [Tarantool-patches] [PATCH 1/4] test: fix flaky qsync_with_anon.test.lua Vladislav Shpilevoy
2020-07-16 20:38 ` [Tarantool-patches] [PATCH 2/4] test: fix flaky qsync_advanced.test.lua Vladislav Shpilevoy
2020-07-16 20:38 ` Vladislav Shpilevoy [this message]
2020-07-16 20:38 ` [Tarantool-patches] [PATCH 4/4] test: fix flaky qsync_basic.test.lua Vladislav Shpilevoy
2020-07-17 13:19 ` [Tarantool-patches] [PATCH 0/4] Flaky qsync tests Alexander V. Tikhonov
2020-07-20 19:23   ` Vladislav Shpilevoy

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=daa9ad2137d37dec3241b2374ea3dc4cde6d961f.1594931843.git.v.shpilevoy@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=avtikhon@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 3/4] test: fix flaky qsync_snapshots.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