Skip to content

Commit efaf3bf

Browse files
committed
updated timeout command
1 parent 0d4dcee commit efaf3bf

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

experiments/bb-exp.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import os
77
import stat
88
import pathlib
9-
# import shutil
9+
import shutil
1010

1111
# recall sys.argv[0] is the script name
1212
if len(sys.argv) < 4 or len(sys.argv) > 5 :
@@ -43,7 +43,10 @@
4343
# 1 hour
4444
MAX_TIME_SECONDS = 3600
4545

46-
TIMEOUT_COMMAND = "timeout 90m "
46+
TIMEOUT_BIN = shutil.which("timeout") or shutil.which("gtimeout")
47+
if TIMEOUT_BIN is None:
48+
raise Exception("Neither 'timeout' nor 'gtimeout' command found. On macOS, please run: 'brew install coreutils'")
49+
TIMEOUT_COMMAND = f"{TIMEOUT_BIN} 90m "
4750

4851
if not os.path.isdir(BASE_DIR):
4952
print("creating folder: " + BASE_DIR)

0 commit comments

Comments
 (0)