tests: Fix race condition in download fixture
Change-Id: Idace0e9e71a484080fc581e232ce217b449085c1 Signed-off-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17453 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
This commit is contained in:
@@ -229,9 +229,14 @@ class DownloadedProgram(Fixture):
|
||||
self.url = self.urlbase + self.path
|
||||
def _download(self):
|
||||
import urllib
|
||||
import errno
|
||||
log.test_log.debug("Downloading " + self.url + " to " + self.path)
|
||||
if not os.path.exists(self.program_dir):
|
||||
os.makedirs(self.program_dir)
|
||||
try:
|
||||
os.makedirs(self.program_dir)
|
||||
except OSError as e:
|
||||
if e.errno != errno.EEXIST:
|
||||
raise
|
||||
urllib.urlretrieve(self.url, self.path)
|
||||
|
||||
def _getremotetime(self):
|
||||
|
||||
Reference in New Issue
Block a user