[Tarantool-patches] [PATCH v1 4/4] test: fix hanging of vinyl/gh.test.lua

Alexander V. Tikhonov avtikhon at tarantool.org
Fri Oct 30 10:00:02 MSK 2020


Found that the previously fixed vinyl/gh.test.lua test in commit:

  94dc5bddc1fb0f9e6ebebfc5aa6be586e5b6759e ('test: gh test hangs after gh-4957-too-many-upserts')

with adding fiber.sleep(1) workaround to avoid of raise from the
previously run vinyl/gh-4957-too-many-upserts.test.lua test can be
changed in the other way. The new change from one side will leave
the found issue untouched to be able to resolve it within opened
issue in github. And from the other side it will let the test-run
tool to be able to avoid of this issue using fragile list feature
to save the stability of testing due to found issue is flaky and
can be passed on reruns.

The current fix changes the forever waiting loop to especially
created for such situations test_run:wait_cond() routine which has
timeout in it to avoid of hanging the test till global timeout will
occure. It will let the testing to be continued even after the fail.

Needed for #5141
---
 test/vinyl/gh.result   | 6 ++----
 test/vinyl/gh.test.lua | 4 +---
 test/vinyl/suite.ini   | 2 +-
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/test/vinyl/gh.result b/test/vinyl/gh.result
index 0fd74af83..a0d3405de 100644
--- a/test/vinyl/gh.result
+++ b/test/vinyl/gh.result
@@ -7,9 +7,6 @@ env = require('test_run')
 test_run = env.new()
 ---
 ...
-fiber.sleep(1)
----
-...
 -- gh-283: hang after three creates and drops
 s = box.schema.space.create('space0', {engine='vinyl'})
 ---
@@ -716,8 +713,9 @@ test_run:cmd("setopt delimiter ''");
 cont = false
 ---
 ...
-while finished ~= 2 do fiber.sleep(0.01) end
+test_run:wait_cond(function() return finished ~= 2 end)
 ---
+- true
 ...
 s:drop()
 ---
diff --git a/test/vinyl/gh.test.lua b/test/vinyl/gh.test.lua
index c72444f5f..b6b9e8b07 100644
--- a/test/vinyl/gh.test.lua
+++ b/test/vinyl/gh.test.lua
@@ -2,8 +2,6 @@ fiber = require('fiber')
 env = require('test_run')
 test_run = env.new()
 
-fiber.sleep(1)
-
 -- gh-283: hang after three creates and drops
 s = box.schema.space.create('space0', {engine='vinyl'})
 i = s:create_index('space0', {type = 'tree', parts = {1, 'string'}})
@@ -311,7 +309,7 @@ end;
 test_run:cmd("setopt delimiter ''");
 
 cont = false
-while finished ~= 2 do fiber.sleep(0.01) end
+test_run:wait_cond(function() return finished ~= 2 end)
 
 s:drop()
 
diff --git a/test/vinyl/suite.ini b/test/vinyl/suite.ini
index 2d69878af..0f7b21793 100644
--- a/test/vinyl/suite.ini
+++ b/test/vinyl/suite.ini
@@ -53,7 +53,7 @@ fragile = {
         },
         "gh.test.lua": {
             "issues": [ "gh-5141" ],
-            "checksums": [ "f1286e9e4710062ddfbffb61b2fe2743", "96b22440ab8a881d6b8d14c5ee1672fb" ]
+            "checksums": [ "f1286e9e4710062ddfbffb61b2fe2743", "96b22440ab8a881d6b8d14c5ee1672fb", "fc77a97c3c891c57d4717087f7a65bd0" ]
         },
         "gh-5141-invalid-vylog-file.test.lua": {
             "issues": [ "gh-5141" ],
-- 
2.25.1



More information about the Tarantool-patches mailing list