[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] When disconnected tor process integ tests timed out



commit 1b5cca5c4a7f9bfb2d56841ce87d6d1bf1903c6b
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Tue May 21 10:39:37 2019 -0700

    When disconnected tor process integ tests timed out
    
    Tor changed its bootstrapping behavior such that when a network connection is
    unavailable we hang at 0% with...
    
      May 21 10:33:30.000 [warn] Problem bootstrapping. Stuck at 0% (starting):
      Starting. (Network is unreachable; NOROUTE; count 10; recommendation warn;
      host 91D23D8A539B83D2FB56AA67ECD4D75CC093AC55 at 37.187.20.59:443)
    
    This caused four of our process integ tests to fail with timeouts...
    
      ======================================================================
      FAIL: test_launch_tor_with_config_via_file
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/home/atagar/Desktop/stem/stem/util/test_tools.py", line 152, in <lambda>
          self.method = lambda test: self.result(test)  # method that can be mixed into TestCases
        File "/home/atagar/Desktop/stem/stem/util/test_tools.py", line 227, in result
          test.fail(self._result.msg)
      AssertionError: Traceback (most recent call last):
        File "/home/atagar/Desktop/stem/stem/util/test_tools.py", line 169, in _wrapper
          runner(*args) if args else runner()
        File "/home/atagar/Desktop/stem/test/integ/process.py", line 462, in test_launch_tor_with_config_via_file
          completion_percent = 5
        File "/home/atagar/Desktop/stem/stem/process.py", line 296, in launch_tor_with_config
          return launch_tor(tor_cmd, args, torrc_path, completion_percent, init_msg_handler, timeout, take_ownership)
        File "/home/atagar/Desktop/stem/stem/process.py", line 153, in launch_tor
          init_line = tor_process.stdout.readline().decode('utf-8', 'replace').strip()
        File "/home/atagar/Desktop/stem/stem/process.py", line 136, in timeout_handler
          raise OSError('reached a %i second timeout without success' % timeout)
      OSError: reached a 90 second timeout without success
    
    In practice these tests don't require any bootstrapping to pass, so dropping
    their required precentage to zero.
---
 test/integ/process.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/integ/process.py b/test/integ/process.py
index 1c8035b5..d3e873f9 100644
--- a/test/integ/process.py
+++ b/test/integ/process.py
@@ -459,7 +459,7 @@ class TestProcess(unittest.TestCase):
               'ControlPort': control_port,
               'DataDirectory': data_directory,
             },
-            completion_percent = 5
+            completion_percent = 0
           )
 
         control_socket = stem.socket.ControlPort(port = int(control_port))
@@ -499,7 +499,7 @@ class TestProcess(unittest.TestCase):
             'ControlPort': control_port,
             'DataDirectory': data_directory,
           },
-          completion_percent = 5
+          completion_percent = 0
         )
 
         control_socket = stem.socket.ControlPort(port = int(control_port))
@@ -594,7 +594,7 @@ class TestProcess(unittest.TestCase):
           'DataDirectory': data_directory,
           '__OwningControllerProcess': str(sleep_process.pid),
         },
-        completion_percent = 5,
+        completion_percent = 0,
       )
 
       # Kill the sleep command. Tor should quit shortly after.
@@ -637,7 +637,7 @@ class TestProcess(unittest.TestCase):
           'ControlPort': control_port,
           'DataDirectory': data_directory,
         },
-        completion_percent = 5,
+        completion_percent = 0,
         take_ownership = True,
       )
 

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits