Skip to content

Commit

Permalink
improving cont build so it emails when rm fails and using wdt-builds@…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
ldemailly committed Oct 6, 2015
1 parent 3efdc29 commit 6f8a96c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from random import randint
import shutil
import tempfile
import errno

def start_receiver(receiver_cmd, root_dir, test_count):
print("Receiver: " + receiver_cmd)
Expand Down Expand Up @@ -36,8 +37,13 @@ def check_transfer_status(status, root_dir, test_count):
exit(status)

def create_directory(root_dir):
if not os.path.exists(root_dir):
os.makedirs(root_dir)
# race condition during stress test can happen even if we check first
try:
os.mkdir(root_dir)
except OSError as e:
if e.errno != errno.EEXIST:
raise e
pass

def create_test_directory(prefix):
user = os.environ['USER']
Expand Down

0 comments on commit 6f8a96c

Please sign in to comment.