Skip to content

Commit 499c73c

Browse files
authored
CI: Optionally disable race detection with env var. (letsencrypt#4674)
This significantly speeds up iteration on integration tests.
1 parent 1f74468 commit 499c73c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/integration-test.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@
3131

3232
from acme import challenges
3333

34+
# Set the environment variable RACE to anything other than 'true' to disable
35+
# race detection. This significantly speeds up integration testing cycles
36+
# locally.
37+
race_detection = True
38+
if os.environ.get('RACE', 'true') != 'true':
39+
race_detection = False
40+
3441
def run_client_tests():
3542
root = os.environ.get("CERTBOT_PATH")
3643
assert root is not None, (
@@ -261,19 +268,19 @@ def main():
261268
now = datetime.datetime.utcnow()
262269

263270
six_months_ago = now+datetime.timedelta(days=-30*6)
264-
if not startservers.start(race_detection=True, fakeclock=fakeclock(six_months_ago)):
271+
if not startservers.start(race_detection=race_detection, fakeclock=fakeclock(six_months_ago)):
265272
raise(Exception("startservers failed (mocking six months ago)"))
266273
v1_integration.caa_client = caa_client = chisel.make_client()
267274
setup_six_months_ago()
268275
startservers.stop()
269276

270277
twenty_days_ago = now+datetime.timedelta(days=-20)
271-
if not startservers.start(race_detection=True, fakeclock=fakeclock(twenty_days_ago)):
278+
if not startservers.start(race_detection=race_detection, fakeclock=fakeclock(twenty_days_ago)):
272279
raise(Exception("startservers failed (mocking twenty days ago)"))
273280
setup_twenty_days_ago()
274281
startservers.stop()
275282

276-
if not startservers.start(race_detection=True, fakeclock=None):
283+
if not startservers.start(race_detection=race_detection, fakeclock=None):
277284
raise(Exception("startservers failed"))
278285

279286
if args.run_chisel:

0 commit comments

Comments
 (0)