From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: imeevma@tarantool.org Subject: [PATCH v1 1/1] vinyl: box/errinj.test.lua fails sporadically Date: Wed, 8 Aug 2018 19:15:30 +0300 Message-Id: <6323e87be4727055f04705e8b936ed2176ca410b.1533744775.git.imeevma@gmail.com> To: tarantool-patches@freelists.org Cc: v.shpilevoy@tarantool.org, vdavydov.dev@gmail.com List-ID: 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