Commit e3400d87 authored by Niles Rogoff's avatar Niles Rogoff Committed by Facebook GitHub Bot

Retry bistro tests up to 5 times

Differential Revision: D25985696

fbshipit-source-id: 52ede8dc494f8bf1991dbfed455fbc6bbba83d87
parent 5b44809e
......@@ -294,11 +294,23 @@ class BistroBuilder(BuilderBase):
):
env = self._compute_env(install_dirs)
build_dir = os.path.join(self.src_dir, "bistro", "bistro", "cmake", "Release")
self._run_cmd(
["ctest", build_dir],
cwd=build_dir,
env=env,
)
NUM_RETRIES = 5
for i in range(NUM_RETRIES):
cmd = ["ctest", "--output-on-failure"]
if i > 0:
cmd.append("--rerun-failed")
cmd.append(build_dir)
try:
self._run_cmd(
cmd,
cwd=build_dir,
env=env,
)
except Exception:
print(f"Tests failed... retrying ({i+1}/{NUM_RETRIES})")
else:
return
raise Exception(f"Tests failed even after {NUM_RETRIES} retries")
class CMakeBuilder(BuilderBase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment