diff options
author | Mark Wong | 2018-02-03 22:15:19 +0000 |
---|---|---|
committer | Mark Wong | 2018-02-04 01:35:58 +0000 |
commit | 015daacf6a8b53a682b989888ae7b75ddc82ccd8 (patch) | |
tree | f47702565f0f755daf780ac7d07add0fbc0e3b89 | |
parent | 00242ae477359b8fde72e5c00ba25fa0316a1400 (diff) |
Move results directory check to start of client
Between the benchmark and collector modules, it's not clear who might
have created the output directory first. Leave a warning in the
benchmark modules for now, otherwise don't let it prevent the tests from
running.
-rw-r--r-- | client/benchmarks/runner.py | 11 | ||||
-rwxr-xr-x | client/perffarm-client.py | 4 |
2 files changed, 10 insertions, 5 deletions
diff --git a/client/benchmarks/runner.py b/client/benchmarks/runner.py index 41a3d7e..4d56187 100644 --- a/client/benchmarks/runner.py +++ b/client/benchmarks/runner.py @@ -56,10 +56,6 @@ class BenchmarkRunner(object): issues = {} - if os.path.exists(self._output): - issues['global'] = ["output directory '%s' already exists" % - (self._output,)] - for config_name in self._configs: t = self._check_config(config_name) if t: @@ -124,7 +120,12 @@ class BenchmarkRunner(object): def run(self): 'run all the configured benchmarks' - os.mkdir(self._output) + # It's ok if the output directory already exists. One of the other + # collector modules may have started before the benchmark. + try: + os.mkdir(self._output) + except OSError as e: + log("WARNING: output directory already exists: %s" % self._output) for config_name in self._configs: self._run_config(config_name) diff --git a/client/perffarm-client.py b/client/perffarm-client.py index 90810e6..035bf7d 100755 --- a/client/perffarm-client.py +++ b/client/perffarm-client.py @@ -20,6 +20,10 @@ from settings import * if __name__ == '__main__': + if os.path.exists(OUTPUT_DIR): + print "output directory '%s' already exists" % OUTPUT_DIR + sys.exit(1) + with FileLock('.lock') as lock: # clone repository and build the sources |