aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-04-06 09:44:50 -0300
committerHisham Muhammad <hisham@gobolinux.org>2018-04-11 14:38:06 -0300
commitec6af45866f86485ca6714398d666a3d6f48b28e (patch)
treeab38c6a3242a856ed26c4204f3b6fafaff9a53f7 /spec
parent43e656302c04caa8db429a204ba293ea3a8c5fac (diff)
downloadluarocks-ec6af45866f86485ca6714398d666a3d6f48b28e.tar.gz
luarocks-ec6af45866f86485ca6714398d666a3d6f48b28e.tar.bz2
luarocks-ec6af45866f86485ca6714398d666a3d6f48b28e.zip
Tests: avoid race between setup_specs and async start of mock-server
Diffstat (limited to 'spec')
-rw-r--r--spec/util/test_env.lua7
1 files changed, 6 insertions, 1 deletions
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)
591 if test_env.run.luarocks_noprint_nocov(test_env.quiet("show " .. rock)) then 591 if test_env.run.luarocks_noprint_nocov(test_env.quiet("show " .. rock)) then
592 return true 592 return true
593 else 593 else
594 return test_env.run.luarocks_noprint_nocov(test_env.quiet("install " .. rock)) 594 local ok = test_env.run.luarocks_noprint_nocov(test_env.quiet("install " .. rock))
595 if not ok then
596 print("WARNING: failed installing " .. rock)
597 end
598 return ok
595 end 599 end
596end 600end
597 601
@@ -763,6 +767,7 @@ function test_env.mock_server_init()
763 lfs.chdir(testing_paths.fixtures_dir) 767 lfs.chdir(testing_paths.fixtures_dir)
764 local final_command = test_env.execute_helper(testing_paths.lua .. " " .. testing_paths.util_dir .. "/mock-server.lua &", true, test_env.env_variables) 768 local final_command = test_env.execute_helper(testing_paths.lua .. " " .. testing_paths.util_dir .. "/mock-server.lua &", true, test_env.env_variables)
765 os.execute(final_command) 769 os.execute(final_command)
770 os.execute("sleep 1")
766 lfs.chdir(pwd) 771 lfs.chdir(pwd)
767end 772end
768 773