Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Belyavskiy <k.belyavskiy@tarantool.org>
To: georgy@tarantool.org
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] [PATCH] replication: stability fix for test recover_missing_xlog
Date: Fri, 18 May 2018 20:01:49 +0300	[thread overview]
Message-ID: <20180518170149.24412-1-k.belyavskiy@tarantool.org> (raw)

This test falls from time to time, because .xlog may have a
different number in a name (and using box.info.lsn is not an
option here).
Since it's setup of two masters, it could be one or two xlogs
in a folder, so first get a list of all matching files and then
delete the last one.
---
branch: https://github.com/tarantool/tarantool/tree/fix-recover-missing-xlog-test
 test/replication/recover_missing_xlog.result   | 5 ++++-
 test/replication/recover_missing_xlog.test.lua | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/test/replication/recover_missing_xlog.result b/test/replication/recover_missing_xlog.result
index 027f8761e..1947b6c0e 100644
--- a/test/replication/recover_missing_xlog.result
+++ b/test/replication/recover_missing_xlog.result
@@ -62,7 +62,10 @@ fio = require('fio')
 -- all missing data from replica.
 -- Also check that there is no concurrency, i.e. master is
 -- in 'read-only' mode unless it receives all data.
-fio.unlink(fio.pathjoin(fio.abspath("."), string.format('autobootstrap1/%020d.xlog', 8)))
+list = fio.glob(fio.pathjoin(fio.abspath("."), 'autobootstrap1/*.xlog'))
+---
+...
+fio.unlink(list[#list])
 ---
 - true
 ...
diff --git a/test/replication/recover_missing_xlog.test.lua b/test/replication/recover_missing_xlog.test.lua
index 57bc7d31f..d33b80399 100644
--- a/test/replication/recover_missing_xlog.test.lua
+++ b/test/replication/recover_missing_xlog.test.lua
@@ -27,7 +27,8 @@ fio = require('fio')
 -- all missing data from replica.
 -- Also check that there is no concurrency, i.e. master is
 -- in 'read-only' mode unless it receives all data.
-fio.unlink(fio.pathjoin(fio.abspath("."), string.format('autobootstrap1/%020d.xlog', 8)))
+list = fio.glob(fio.pathjoin(fio.abspath("."), 'autobootstrap1/*.xlog'))
+fio.unlink(list[#list])
 test_run:cmd("start server autobootstrap1")
 
 test_run:cmd("switch autobootstrap1")
-- 
2.14.3 (Apple Git-98)

             reply	other threads:[~2018-05-18 17:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18 17:01 Konstantin Belyavskiy [this message]
2018-05-19 20:49 ` [tarantool-patches] " Konstantin Osipov

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=20180518170149.24412-1-k.belyavskiy@tarantool.org \
    --to=k.belyavskiy@tarantool.org \
    --cc=georgy@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH] replication: stability fix for test recover_missing_xlog' \
    /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