From 3030f27f86a1d8e309b7763b8079a71ddf0c7ee8 Mon Sep 17 00:00:00 2001
From: Vladimir Davydov <vdavydov.dev@gmail.com>
Date: Tue, 11 Dec 2018 19:41:44 +0300
Subject: [PATCH] test: fix box/backup spurious failure

Follow-up 071918421f48 ("gc: run garbage collection in background").

Closes #3855
---
 test/box/backup.result   | 7 +++++--
 test/box/backup.test.lua | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/test/box/backup.result b/test/box/backup.result
index f2286b6bc7..6683d58471 100644
--- a/test/box/backup.result
+++ b/test/box/backup.result
@@ -109,8 +109,11 @@ do_backup(files)
 box.backup.stop()
 ---
 ...
--- Previous checkpoint must have been removed by garbage collection
--- as soon as box.backup.stop() was called.
+-- Wait for the garbage collector to remove the previous checkpoint.
+test_run:wait_cond(function() return #box.info.gc().checkpoints == 1 end, 10)
+---
+- true
+...
 files = box.backup.start(1) -- error: checkpoint not found
 ---
 - error: Can't find snapshot
diff --git a/test/box/backup.test.lua b/test/box/backup.test.lua
index 46703d5481..440261b50a 100644
--- a/test/box/backup.test.lua
+++ b/test/box/backup.test.lua
@@ -70,8 +70,8 @@ box.snapshot()
 do_backup(files)
 box.backup.stop()
 
--- Previous checkpoint must have been removed by garbage collection
--- as soon as box.backup.stop() was called.
+-- Wait for the garbage collector to remove the previous checkpoint.
+test_run:wait_cond(function() return #box.info.gc().checkpoints == 1 end, 10)
 files = box.backup.start(1) -- error: checkpoint not found
 
 -- Check that we can restore from the backup we've just made.
-- 
GitLab