[tor-commits] [stem/master] Our ONLINE target could fail with an undefined 'streams'

atagar at torproject.org atagar at torproject.org
Mon Feb 9 17:06:59 UTC 2015


commit 6069f40bcb5114265345dd74fb312d9af46ee8a3
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon Feb 9 09:07:08 2015 -0800

    Our ONLINE target could fail with an undefined 'streams'
    
    Doesn't make the test pass, but was masking the actual issue which is
    "SocksError: [6] TTL expired".
    
    ======================================================================
    ERROR: test_attachstream
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/atagar/Desktop/stem/test/integ/control/controller.py", line 1206, in test_attachstream
        our_stream = [stream for stream in streams if stream.target_address == host][0]
    UnboundLocalError: local variable 'streams' referenced before assignment
---
 test/integ/control/controller.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/integ/control/controller.py b/test/integ/control/controller.py
index 0839bc1..6ec03a0 100644
--- a/test/integ/control/controller.py
+++ b/test/integ/control/controller.py
@@ -1176,7 +1176,7 @@ class TestController(unittest.TestCase):
     host = '38.229.72.14'   # www.torproject.org
     port = 80
 
-    circuit_id = None
+    circuit_id, streams = None, []
 
     def handle_streamcreated(stream):
       if stream.status == 'NEW' and circuit_id:



More information about the tor-commits mailing list