mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Bug 1559975 - convert testing/awsy to python3 syntax r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D35327 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
2d69e323f1
commit
1fd0b4e594
@ -174,7 +174,7 @@ class AwsyTestCase(MarionetteTestCase):
|
||||
try:
|
||||
result = self.marionette.execute_async_script(
|
||||
gc_script, script_timeout=180000)
|
||||
except JavascriptException, e:
|
||||
except JavascriptException as e:
|
||||
self.logger.error("GC JavaScript error: %s" % e)
|
||||
except ScriptTimeoutException:
|
||||
self.logger.error("GC timed out")
|
||||
@ -224,7 +224,7 @@ class AwsyTestCase(MarionetteTestCase):
|
||||
checkpoint_script, script_timeout=60000)
|
||||
if finished:
|
||||
checkpoint = checkpoint_path
|
||||
except JavascriptException, e:
|
||||
except JavascriptException as e:
|
||||
self.logger.error("Checkpoint JavaScript error: %s" % e)
|
||||
except ScriptTimeoutException:
|
||||
self.logger.error("Memory report timed out")
|
||||
@ -292,7 +292,7 @@ class AwsyTestCase(MarionetteTestCase):
|
||||
for f in incomplete:
|
||||
os.remove(os.path.join(tmpdir, f))
|
||||
|
||||
except JavascriptException, e:
|
||||
except JavascriptException as e:
|
||||
self.logger.error("DMD JavaScript error: %s" % e)
|
||||
except ScriptTimeoutException:
|
||||
self.logger.error("DMD timed out")
|
||||
|
@ -145,18 +145,18 @@ if __name__ == "__main__":
|
||||
totals = calculate_memory_report_values(
|
||||
args.report, args.prefix, args.proc_filter)
|
||||
|
||||
sorted_totals = sorted(totals.iteritems(), key=lambda(k, v): (-v, k))
|
||||
sorted_totals = sorted(totals.items(), key=lambda item: (-item[1], item[0]))
|
||||
for (k, v) in sorted_totals:
|
||||
if v:
|
||||
print "{0}\t".format(k),
|
||||
print ""
|
||||
print("{0}\t".format(k)),
|
||||
print("")
|
||||
|
||||
bytes_per_mebibyte = 1024.0 * 1024.0
|
||||
for (k, v) in sorted_totals:
|
||||
if v:
|
||||
if args.mebi:
|
||||
print "{0:.2f} MiB".format(v / bytes_per_mebibyte),
|
||||
print("{0:.2f} MiB".format(v / bytes_per_mebibyte)),
|
||||
else:
|
||||
print "{0} bytes".format(v),
|
||||
print "\t",
|
||||
print ""
|
||||
print("{0} bytes".format(v)),
|
||||
print("\t"),
|
||||
print("")
|
||||
|
@ -68,7 +68,7 @@ def update_checkpoint_paths(checkpoint_files, checkpoints):
|
||||
if indices:
|
||||
checkpoints[indices[0]]['path'] = paths[idx]
|
||||
else:
|
||||
print "found files but couldn't find %s" % name
|
||||
print("found files but couldn't find {}").format(name)
|
||||
|
||||
|
||||
def create_suite(name, node, data_path, checkpoints=CHECKPOINTS,
|
||||
@ -164,7 +164,7 @@ def create_perf_data(data_path, perf_suites=PERF_SUITES, checkpoints=CHECKPOINTS
|
||||
Builds up a performance data blob suitable for submitting to perfherder.
|
||||
"""
|
||||
if ("GCOV_PREFIX" in os.environ) or ("JS_CODE_COVERAGE_OUTPUT_DIR" in os.environ):
|
||||
print "Code coverage is being collected, performance data will not be gathered."
|
||||
print("Code coverage is being collected, performance data will not be gathered.")
|
||||
return {}
|
||||
|
||||
perf_blob = {
|
||||
@ -183,12 +183,12 @@ def create_perf_data(data_path, perf_suites=PERF_SUITES, checkpoints=CHECKPOINTS
|
||||
if __name__ == '__main__':
|
||||
args = sys.argv[1:]
|
||||
if not args:
|
||||
print "Usage: process_perf_data.py data_path"
|
||||
print("Usage: process_perf_data.py data_path")
|
||||
sys.exit(1)
|
||||
|
||||
# Determine which revisions we need to process.
|
||||
data_path = args[0]
|
||||
perf_blob = create_perf_data(data_path)
|
||||
print "PERFHERDER_DATA: %s" % json.dumps(perf_blob)
|
||||
print("PERFHERDER_DATA: {}").format(json.dumps(perf_blob))
|
||||
|
||||
sys.exit(0)
|
||||
|
@ -187,7 +187,7 @@ class TestMemoryUsage(AwsyTestCase):
|
||||
try:
|
||||
result = self.marionette.execute_script(script,
|
||||
script_timeout=180000)
|
||||
except JavascriptException, e:
|
||||
except JavascriptException as e:
|
||||
self.logger.error("removePreloadedBrowser() JavaScript error: %s" % e)
|
||||
except ScriptTimeoutException:
|
||||
self.logger.error("removePreloadedBrowser() timed out")
|
||||
|
@ -37,17 +37,17 @@ class WebServers(object):
|
||||
docroot=self.docroot))
|
||||
try:
|
||||
self.servers[-1].start()
|
||||
except socket.error, error:
|
||||
except socket.error as error:
|
||||
if isinstance(error, socket.error):
|
||||
if error.errno == 98:
|
||||
print "port %d is in use." % port
|
||||
print("port {} is in use.").format(port)
|
||||
else:
|
||||
print "port %d error %s" % (port, error)
|
||||
print("port {} error {}").format(port, error)
|
||||
elif isinstance(error, str):
|
||||
print "port %d error %s" % (port, error)
|
||||
print("port {} error {}").format(port, error)
|
||||
self.servers.pop()
|
||||
except Exception, error:
|
||||
print "port %d error %s" % (port, error)
|
||||
except Exception as error:
|
||||
print("port {} error {}").format(port, error)
|
||||
self.servers.pop()
|
||||
|
||||
port += 1
|
||||
|
@ -20,7 +20,6 @@ py3:
|
||||
- modules/freetype2
|
||||
- security/manager/ssl
|
||||
- servo
|
||||
- testing/awsy
|
||||
- testing/mochitest
|
||||
- testing/mozharness
|
||||
- testing/tools/iceserver
|
||||
|
Loading…
x
Reference in New Issue
Block a user