Andreas Sandberg has submitted this change and it was merged. ( https://gem5-review.googlesource.com/2320 )

Change subject: tests: Warn not fail when reading invalid pickle status files
......................................................................

tests: Warn not fail when reading invalid pickle status files

With this change, the test script will output a warning when it reads
an incomplete (e.g., when a regression is still running) or corrupt
status file instead of throwing an exception. When the scipt is used
to show the results the corrupt file is skipped; when it is used to
test if all regressions run successfully it will return an error value
(2).

Change-Id: Ie7d9b457b200e3abc7ae6238e3efbf3d18cf4297
Signed-off-by: Andreas Sandberg <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/2320
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
---
M tests/tests.py
1 file changed, 16 insertions(+), 2 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved



diff --git a/tests/tests.py b/tests/tests.py
index 3f6ed0a..bb64866 100755
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -242,8 +242,18 @@
                         help="Pickled test results")

 def _show(args):
+    def _load(f):
+        # Load the pickled status file, sometimes e.g., when a
+        # regression is still running the status file might be
+        # incomplete.
+        try:
+            return pickle.load(f)
+        except EOFError:
+            print >> sys.stderr, 'Could not read file %s' % f.name
+            return []
+
     formatter = _create_formatter(args)
-    suites = sum([ pickle.load(f) for f in args.result ], [])
+    suites = sum([ _load(f) for f in args.result ], [])
     formatter.dump_suites(suites)

 def _test_args(subparsers):
@@ -276,7 +286,11 @@
                         help="Pickled test results")

 def _test(args):
-    suites = sum([ pickle.load(f) for f in args.result ], [])
+    try:
+        suites = sum([ pickle.load(f) for f in args.result ], [])
+    except EOFError:
+        print >> sys.stderr, 'Could not read all files'
+        sys.exit(2)

     if all(s for s in suites):
         sys.exit(0)

--
To view, visit https://gem5-review.googlesource.com/2320
To unsubscribe, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie7d9b457b200e3abc7ae6238e3efbf3d18cf4297
Gerrit-Change-Number: 2320
Gerrit-PatchSet: 2
Gerrit-Owner: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to