mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
Update web-platform-tests to revision cf261625e2d230ab219eec966f4abe26e3401b64
This commit is contained in:
parent
11a89bcc47
commit
8f98acd0e7
297 changed files with 3396 additions and 1555 deletions
|
@ -1,3 +1,4 @@
|
|||
import logging
|
||||
import os
|
||||
import subprocess
|
||||
import time
|
||||
|
@ -19,15 +20,19 @@ class WPTServer(object):
|
|||
|
||||
def start(self):
|
||||
self.devnull = open(os.devnull, 'w')
|
||||
wptserve_cmd = [os.path.join(self.wpt_root, 'wpt'), 'serve']
|
||||
logging.info('Executing %s' % ' '.join(wptserve_cmd))
|
||||
self.proc = subprocess.Popen(
|
||||
[os.path.join(self.wpt_root, 'wpt'), 'serve'],
|
||||
wptserve_cmd,
|
||||
stderr=self.devnull,
|
||||
cwd=self.wpt_root)
|
||||
|
||||
for retry in range(5):
|
||||
# Exponential backoff.
|
||||
time.sleep(2 ** retry)
|
||||
if self.proc.poll() != None:
|
||||
exit_code = self.proc.poll()
|
||||
if exit_code != None:
|
||||
logging.warn('Command "%s" exited with %s', ' '.join(wptserve_cmd), exit_code)
|
||||
break
|
||||
try:
|
||||
urllib2.urlopen(self.base_url, timeout=1)
|
||||
|
@ -35,7 +40,7 @@ class WPTServer(object):
|
|||
except urllib2.URLError:
|
||||
pass
|
||||
|
||||
raise Exception('Could not start wptserve.')
|
||||
raise Exception('Could not start wptserve on %s' % self.base_url)
|
||||
|
||||
def stop(self):
|
||||
self.proc.terminate()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue