Tarantool development patches archive
 help / color / mirror / Atom feed
From: imeevma@tarantool.org
To: tarantool-patches@freelists.org
Cc: v.shpilevoy@tarantool.org, vdavydov.dev@gmail.com
Subject: [PATCH v1 1/1] vinyl: box/errinj.test.lua fails sporadically
Date: Wed,  8 Aug 2018 19:15:30 +0300	[thread overview]
Message-ID: <6323e87be4727055f04705e8b936ed2176ca410b.1533744775.git.imeevma@gmail.com> (raw)

In some cases operation box.snapshot() was longer than
expected. This lead to situation when previous error
was repeated instead of new one. Now these errors
completely separated.

Closes #3599.
---
Branch:  imeevma/gh-3599-box-errinj-fails-sporadically
Issue: https://github.com/tarantool/tarantool/issues/3599

 test/box/errinj.result   | 22 ++++++++++++++++++----
 test/box/errinj.test.lua | 15 +++++++++++----
 2 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/test/box/errinj.result b/test/box/errinj.result
index 78aebf1..97546e5 100644
--- a/test/box/errinj.result
+++ b/test/box/errinj.result
@@ -1284,8 +1284,9 @@ errinj.set('ERRINJ_VY_LOG_FILE_RENAME', false)
 ---
 - ok
 ...
-for i = 1, 10 do box.space.test:insert{i} end
+errinj.set('ERRINJ_VY_GC', true)
 ---
+- ok
 ...
 errinj.set('ERRINJ_VY_SCHED_TIMEOUT', 0.001)
 ---
@@ -1295,20 +1296,29 @@ errinj.set('ERRINJ_VY_RUN_FILE_RENAME', true)
 ---
 - ok
 ...
+box.space.test:insert{1}
+---
+- [1]
+...
 box.snapshot() -- error
 ---
 - error: Error injection 'vinyl run file rename'
 ...
-errinj.set('ERRINJ_VY_INDEX_FILE_RENAME', true)
+errinj.set('ERRINJ_VY_RUN_FILE_RENAME', false)
 ---
 - ok
 ...
-errinj.set('ERRINJ_VY_RUN_FILE_RENAME', false)
+-- Wait for the scheduler to unthrottle.
+repeat fiber.sleep(0.001) until pcall(box.snapshot)
+---
+...
+errinj.set('ERRINJ_VY_INDEX_FILE_RENAME', true)
 ---
 - ok
 ...
-fiber.sleep(0.01)
+box.space.test:insert{2}
 ---
+- [2]
 ...
 box.snapshot() -- error
 ---
@@ -1322,6 +1332,10 @@ errinj.set('ERRINJ_VY_SCHED_TIMEOUT', 0)
 ---
 - ok
 ...
+errinj.set('ERRINJ_VY_GC', false)
+---
+- ok
+...
 #fio.glob(fio.pathjoin(box.cfg.vinyl_dir, '*.vylog.inprogress')) > 0
 ---
 - true
diff --git a/test/box/errinj.test.lua b/test/box/errinj.test.lua
index 04f09bd..5c0465e 100644
--- a/test/box/errinj.test.lua
+++ b/test/box/errinj.test.lua
@@ -448,17 +448,24 @@ errinj.set('ERRINJ_VY_LOG_FILE_RENAME', true)
 box.snapshot()
 errinj.set('ERRINJ_VY_LOG_FILE_RENAME', false)
 
-for i = 1, 10 do box.space.test:insert{i} end
-
+errinj.set('ERRINJ_VY_GC', true)
 errinj.set('ERRINJ_VY_SCHED_TIMEOUT', 0.001)
+
 errinj.set('ERRINJ_VY_RUN_FILE_RENAME', true)
+box.space.test:insert{1}
 box.snapshot() -- error
-errinj.set('ERRINJ_VY_INDEX_FILE_RENAME', true)
 errinj.set('ERRINJ_VY_RUN_FILE_RENAME', false)
-fiber.sleep(0.01)
+
+-- Wait for the scheduler to unthrottle.
+repeat fiber.sleep(0.001) until pcall(box.snapshot)
+
+errinj.set('ERRINJ_VY_INDEX_FILE_RENAME', true)
+box.space.test:insert{2}
 box.snapshot() -- error
 errinj.set('ERRINJ_VY_INDEX_FILE_RENAME', false)
+
 errinj.set('ERRINJ_VY_SCHED_TIMEOUT', 0)
+errinj.set('ERRINJ_VY_GC', false)
 
 #fio.glob(fio.pathjoin(box.cfg.vinyl_dir, '*.vylog.inprogress')) > 0
 #fio.glob(fio.pathjoin(box.cfg.vinyl_dir, box.space.test.id, 0, '*.run.inprogress')) > 0
-- 
2.7.4

             reply	other threads:[~2018-08-08 16:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 16:15 imeevma [this message]
2018-08-08 16:31 ` Vladimir Davydov

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=6323e87be4727055f04705e8b936ed2176ca410b.1533744775.git.imeevma@gmail.com \
    --to=imeevma@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH v1 1/1] vinyl: box/errinj.test.lua fails sporadically' \
    /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