From b9a05d098da3f6fd64e2fe64bdcbfee6d0df0438 Mon Sep 17 00:00:00 2001
From: Vladimir Davydov <vdavydov.dev@gmail.com>
Date: Wed, 10 Apr 2019 17:44:57 +0300
Subject: [PATCH] test: fix vinyl/errinj_stat again
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Another failure this time:

 | [024] —- vinyl/errinj_stat.result  Wed Apr 10 14:21:34 2019
 | [024] +++ vinyl/errinj_stat.reject  Wed Apr 10 14:24:15 2019
 | [024] @@ -220,7 +220,7 @@
 | [024]  ...
 | [024]  box.snapshot()
 | [024]  —-
 | [024] — error: Error injection 'vinyl dump'
 | [024] +- error: Snapshot is already in progress
 | [024]  ...
 | [024]  stat = box.stat.vinyl().scheduler
 | [024]  —-
 | [024] @@ -231,7 +231,7 @@
 | [024]  ...
 | [024]  stat.tasks_failed > 0
 | [024]  —-
 | [024] — true
 | [024] +- false
 | [024]  ...
 | [024]  errinj.set('ERRINJ_VY_RUN_WRITE', false)
 | [024]  —-

Hope it's the last time we fix it.

Follow-up commit f4b80bcf4908 ("test: fix vinyl/errinj_stat failure").
---
 test/vinyl/errinj_stat.result   | 8 ++++++++
 test/vinyl/errinj_stat.test.lua | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/test/vinyl/errinj_stat.result b/test/vinyl/errinj_stat.result
index a4e6335738..f1133137ec 100644
--- a/test/vinyl/errinj_stat.result
+++ b/test/vinyl/errinj_stat.result
@@ -191,6 +191,10 @@ test_run:wait_cond(function() return box.stat.vinyl().scheduler.tasks_completed
 ---
 - true
 ...
+test_run:wait_cond(function() return not box.info.gc().checkpoint_is_in_progress end)
+---
+- true
+...
 stat = box.stat.vinyl().scheduler
 ---
 ...
@@ -325,6 +329,10 @@ test_run:wait_cond(function() return box.stat.vinyl().scheduler.tasks_completed
 ---
 - true
 ...
+test_run:wait_cond(function() return not box.info.gc().checkpoint_is_in_progress end)
+---
+- true
+...
 i:stat().disk.dump.time >= 0.1
 ---
 - true
diff --git a/test/vinyl/errinj_stat.test.lua b/test/vinyl/errinj_stat.test.lua
index c3000bba7d..d11da45012 100644
--- a/test/vinyl/errinj_stat.test.lua
+++ b/test/vinyl/errinj_stat.test.lua
@@ -60,6 +60,7 @@ box.stat.reset() -- doesn't affect tasks_inprogress
 box.stat.vinyl().scheduler.tasks_inprogress > 0
 errinj.set('ERRINJ_VY_RUN_WRITE_DELAY', false)
 test_run:wait_cond(function() return box.stat.vinyl().scheduler.tasks_completed > 0 end)
+test_run:wait_cond(function() return not box.info.gc().checkpoint_is_in_progress end)
 stat = box.stat.vinyl().scheduler
 stat.tasks_inprogress == 0
 stat.tasks_completed == 1
@@ -101,6 +102,7 @@ test_run:wait_cond(function() return box.stat.vinyl().scheduler.tasks_inprogress
 fiber.sleep(0.1)
 errinj.set('ERRINJ_VY_RUN_WRITE_DELAY', false)
 test_run:wait_cond(function() return box.stat.vinyl().scheduler.tasks_completed > 0 end)
+test_run:wait_cond(function() return not box.info.gc().checkpoint_is_in_progress end)
 i:stat().disk.dump.time >= 0.1
 i:stat().disk.dump.time <= fiber.time() - start_time
 i:stat().disk.compaction.time == 0
-- 
GitLab