From 574be576847878284a979541529622b3d1e78338 Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Mon, 14 Mar 2011 15:52:13 -0700 Subject: [PATCH] Avoid race condition on creating directory by pre-creating early. Change-Id: I9fed7319609848ba90abfaa147fad85bd4114fdc BUG=TreeCloser TEST=Ran it locally in a VM a cpl times. Review URL: http://codereview.chromium.org/6696002 --- bin/au_test_harness/cros_au_test_harness.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/au_test_harness/cros_au_test_harness.py b/bin/au_test_harness/cros_au_test_harness.py index 8cb83b23fb..e72b386cbf 100755 --- a/bin/au_test_harness/cros_au_test_harness.py +++ b/bin/au_test_harness/cros_au_test_harness.py @@ -275,6 +275,10 @@ def main(): # Clean up previous work if requested. if options.clean: _CleanPreviousWork(options) + # Make sure we have a log directory. + if not os.path.exists(options.test_results_root): + os.makedirs(options.test_results_root) + # Generate cache of updates to use during test harness. update_cache = _PregenerateUpdates(options) au_worker.AUWorker.SetUpdateCache(update_cache)