[tor-commits] [stem/master] Revise approach to owning Tor in integ tests

atagar at torproject.org atagar at torproject.org
Sun May 19 19:34:11 UTC 2013


commit b626f0c5156e8f5d2a89558ce54890b931648758
Author: Jeremy <saturn5971 at gmail.com>
Date:   Sat May 18 22:08:57 2013 -0400

    Revise approach to owning Tor in integ tests
    
    The integ tests now only try to own the Tor process via control
    connection if controllers have a way to access Tor. This is needed to
    successfully run under the RUN_NONE target.
---
 run_tests.py |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/run_tests.py b/run_tests.py
index b59b405..67c9a1d 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -185,10 +185,16 @@ def main():
 
         println("Running tests...\n", STATUS)
 
-        with integ_runner.get_tor_controller(True):  # Controller to own our main tor process
-          for test_class in test.util.get_integ_tests(args.test_prefix):
-              run_result = _run_test(test_class, output_filters, logging_buffer)
-              skipped_tests += len(getattr(run_result, 'skipped', []))
+        owner = None
+        if integ_runner.is_accessible():
+          owner = integ_runner.get_tor_controller(True)  # controller to own our main Tor process
+
+        for test_class in test.util.get_integ_tests(args.test_prefix):
+          run_result = _run_test(test_class, output_filters, logging_buffer)
+          skipped_tests += len(getattr(run_result, 'skipped', []))
+
+        if owner:
+          owner.close()
 
         # We should have joined on all threads. If not then that indicates a
         # leak that could both likely be a bug and disrupt further targets.



More information about the tor-commits mailing list