Bug 1285550 - Ensure 'run-mozharness' binary exists before invoking from interactive wizard, r=armenzg

This fixes a race condition between the 'test-linux.sh' process and the 'taskcluster-interactive-shell'
process in interactive tasks.

MozReview-Commit-ID: GhqKpq5pAtj

--HG--
extra : rebase_source : 67b756d0373432404a4f7cc928bac09fc3f82e8a
This commit is contained in:
Andrew Halberstadt 2016-07-08 10:28:07 -04:00
parent 9f969a70a2
commit 97becf10e0

View File

@ -5,18 +5,34 @@
from __future__ import print_function, unicode_literals
import datetime
import os
import subprocess
import sys
import time
from textwrap import wrap
here = os.path.dirname(os.path.abspath(__file__))
def call(cmd, **kwargs):
print(" ".join(cmd))
return subprocess.call(cmd, **kwargs)
def wait_for_run_mozharness(timeout=30):
starttime = datetime.datetime.now()
while datetime.datetime.now() - starttime < datetime.timedelta(seconds=timeout):
if os.path.isfile(os.path.join(here, 'run-mozharness')):
break
time.sleep(0.2)
else:
print("Timed out after %d seconds waiting for the 'run-mozharness' binary" % timeout)
return 1
def resume():
wait_for_run_mozharness()
call(['run-mozharness'])
@ -27,6 +43,7 @@ def setup():
downloading the tests and firefox binary. But it stops before running the
tests.
"""
wait_for_run_mozharness()
status = call(['run-mozharness', '--no-run-tests'])
if status: