[tor-commits] [stem/master] Stacktrace when tests call is_accessible after stopping

atagar at torproject.org atagar at torproject.org
Fri Apr 13 18:51:43 UTC 2018


commit 2018f3fd2642f43aeab8e1e0d2142a6a4905e651
Author: Damian Johnson <atagar at torproject.org>
Date:   Fri Apr 13 11:49:08 2018 -0700

    Stacktrace when tests call is_accessible after stopping
    
    Huh. I can't repro this failure and I'm unsure how it arose, but our jenkins
    tests failed a test run with...
    
      ======================================================================
      ERROR: test_attachstream
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/srv/jenkins-workspace/workspace/stem-tor-ci/test/require.py", line 57, in wrapped
          if condition():
        File "/srv/jenkins-workspace/workspace/stem-tor-ci/test/require.py", line 68, in _can_access_controller
          return test.runner.get_runner().is_accessible()
        File "/srv/jenkins-workspace/workspace/stem-tor-ci/test/runner.py", line 341, in is_accessible
          return Torrc.PORT in self._custom_opts or Torrc.SOCKET in self._custom_opts
      TypeError: argument of type 'NoneType' is not iterable
    
    This should only arise if we haven't called start() on our Runner, or called
    its stop() method before the test ran. In either case there's no doubt a second
    bug here but for the moment just making this obvious fix. All callers expect
    the opts to be a collection, so no reason not to initialize it to one.
---
 test/runner.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/runner.py b/test/runner.py
index bd3fe8a4..160e4827 100644
--- a/test/runner.py
+++ b/test/runner.py
@@ -161,7 +161,7 @@ class Runner(object):
     self._tor_cmd = None
     self._tor_cwd = ''
     self._torrc_contents = ''
-    self._custom_opts = None
+    self._custom_opts = []
     self._tor_process = None
     self._chroot_path = None
 
@@ -308,7 +308,7 @@ class Runner(object):
       self._tor_cmd = None
       self._tor_cwd = ''
       self._torrc_contents = ''
-      self._custom_opts = None
+      self._custom_opts = []
       self._tor_process = None
 
       println('done', STATUS)



More information about the tor-commits mailing list