From ec6af45866f86485ca6714398d666a3d6f48b28e Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Fri, 6 Apr 2018 09:44:50 -0300 Subject: Tests: avoid race between setup_specs and async start of mock-server --- spec/util/test_env.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua index fbb46d82..998aeb2b 100644 --- a/spec/util/test_env.lua +++ b/spec/util/test_env.lua @@ -591,7 +591,11 @@ function test_env.need_rock(rock) if test_env.run.luarocks_noprint_nocov(test_env.quiet("show " .. rock)) then return true else - return test_env.run.luarocks_noprint_nocov(test_env.quiet("install " .. rock)) + local ok = test_env.run.luarocks_noprint_nocov(test_env.quiet("install " .. rock)) + if not ok then + print("WARNING: failed installing " .. rock) + end + return ok end end @@ -763,6 +767,7 @@ function test_env.mock_server_init() lfs.chdir(testing_paths.fixtures_dir) local final_command = test_env.execute_helper(testing_paths.lua .. " " .. testing_paths.util_dir .. "/mock-server.lua &", true, test_env.env_variables) os.execute(final_command) + os.execute("sleep 1") lfs.chdir(pwd) end -- cgit v1.2.3-55-g6feb