bug 1517244 - Try to log more info during intermittent test_telemetry failure. r=sheehan
authorTed Mielczarek <ted@mielczarek.org>
Wed, 02 Jan 2019 16:56:12 +0000
changeset 509389 7ce57fba4ad06615ddfa701b3e9b224f83b2b7a3
parent 509388 b0471cb7631f638fddf2776a50eeb641ac04e5f1
child 509390 7e75579b27d017c48a83e04db1588f7232cc750a
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssheehan
bugs1517244
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1517244 - Try to log more info during intermittent test_telemetry failure. r=sheehan Differential Revision: https://phabricator.services.mozilla.com/D15578
python/mach/mach/test/test_telemetry.py
--- a/python/mach/mach/test/test_telemetry.py
+++ b/python/mach/mach/test/test_telemetry.py
@@ -32,18 +32,24 @@ def run_mach(tmpdir):
 
     def run(*args, **kwargs):
         # Run mach with the provided arguments
         subprocess.check_output([sys.executable, mach] + list(args),
                                 stderr=subprocess.STDOUT,
                                 env=env,
                                 **kwargs)
         # Load any telemetry data that was written
-        path = unicode(tmpdir.join('telemetry', 'outgoing'))
-        return [json.load(open(os.path.join(path, f), 'rb')) for f in os.listdir(path)]
+        path = tmpdir.join('telemetry', 'outgoing')
+        try:
+            return [json.load(f.open('rb')) for f in path.listdir()]
+        except EnvironmentError:
+            for p in path.parts(reverse=True):
+                if not p.check(dir=1):
+                    print('Path does not exist: "%s"' % p, file=sys.stderr)
+            raise
     return run
 
 
 def test_simple(run_mach, tmpdir):
     data = run_mach('python', '-c', 'pass')
     assert len(data) == 1
     d = data[0]
     assert d['command'] == 'python'