[tor-commits] [stem/master] Stop running (all) integ tests on receiving a SIGINT. Fix #5199

atagar at torproject.org atagar at torproject.org
Tue Feb 21 23:38:48 UTC 2012


commit 9a7b383c18e42cbce093803e8cdd04d98aa900c5
Author: Ravi Chandra Padmala <neenaoffline at gmail.com>
Date:   Wed Feb 22 10:13:52 2012 +0530

    Stop running (all) integ tests on receiving a SIGINT. Fix #5199
---
 run_tests.py   |    5 +++++
 test/runner.py |    3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/run_tests.py b/run_tests.py
index 25cd0f2..b59d3c3 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -69,6 +69,8 @@ Target = stem.util.enum.UppercaseEnum(
 
 DEFAULT_RUN_TARGET = Target.RUN_OPEN
 
+ERROR_ATTR = (term.Color.RED, term.Attr.BOLD)
+
 # Tests are ordered by the dependencies so the lowest level tests come first.
 # This is because a problem in say, controller message parsing, will cause all
 # higher level tests to fail too. Hence we want the test that most narrowly
@@ -302,6 +304,9 @@ if __name__ == '__main__':
           print
           
           test.output.print_logging(logging_buffer)
+      except KeyboardInterrupt:
+        test.output.print_line("  aborted starting tor: keyboard interrupt\n", *ERROR_ATTR)
+        break
       except OSError:
         pass
       finally:
diff --git a/test/runner.py b/test/runner.py
index cf596d8..564f503 100644
--- a/test/runner.py
+++ b/test/runner.py
@@ -548,9 +548,6 @@ class Runner:
       
       runtime = time.time() - start_time
       test.output.print_line("  done (%i seconds)\n" % runtime, *STATUS_ATTR)
-    except KeyboardInterrupt:
-      test.output.print_line("  aborted starting tor: keyboard interrupt\n", *ERROR_ATTR)
-      raise OSError("keyboard interrupt")
     except OSError, exc:
       test.output.print_line("  failed to start tor: %s\n" % exc, *ERROR_ATTR)
       raise exc





More information about the tor-commits mailing list