Skip to content

Commit 6f8a96c

Browse files
committed
improving cont build so it emails when rm fails and using wdt-builds@ instead of hardcoding our name, fixing mkdir race condition in tests
Summary: improving cont build so it emails when rm fails and using wdt-builds@ instead of hardcoding our name, fixing mkdir race condition in tests Reviewed By: @nikunjy Differential Revision: D2511598 fb-gh-sync-id: cdaa58229a59e150d743e52d5fb76ef42111a0b0
1 parent 3efdc29 commit 6f8a96c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

common_utils.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from random import randint
1010
import shutil
1111
import tempfile
12+
import errno
1213

1314
def start_receiver(receiver_cmd, root_dir, test_count):
1415
print("Receiver: " + receiver_cmd)
@@ -36,8 +37,13 @@ def check_transfer_status(status, root_dir, test_count):
3637
exit(status)
3738

3839
def create_directory(root_dir):
39-
if not os.path.exists(root_dir):
40-
os.makedirs(root_dir)
40+
# race condition during stress test can happen even if we check first
41+
try:
42+
os.mkdir(root_dir)
43+
except OSError as e:
44+
if e.errno != errno.EEXIST:
45+
raise e
46+
pass
4147

4248
def create_test_directory(prefix):
4349
user = os.environ['USER']

0 commit comments

Comments
 (0)