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

[tor-commits] [stem/master] Bumping sleep for test_reattaching_listeners



commit a5f81683e1c29ba37cc4e97f0581d20c3949eb8b
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Mon Apr 29 08:11:52 2013 -0700

    Bumping sleep for test_reattaching_listeners
    
    On our jenkins instance we're seeing this test fail roughly 1/24 of the time
    (breaking one target in 1/3 of the test runs). We *should* be doing some kind
    of activity guarenteed to trigger an event rather than rely on a BW event being
    emitted each second. For now trying to simply bump its sleeps though to see if
    that relieve the symptoms.
    
    This adds around eight seconds to our integ runtime so definitely something we
    should look into doing right later.
---
 test/integ/control/controller.py |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/test/integ/control/controller.py b/test/integ/control/controller.py
index a89d9be..4909399 100644
--- a/test/integ/control/controller.py
+++ b/test/integ/control/controller.py
@@ -32,6 +32,10 @@ TEST_ROUTER_STATUS_ENTRY = None
 
 
 class TestController(unittest.TestCase):
+  # TODO: We should find an event we can reliably trigger rather than using BW
+  # events with sleeps. This both slows our tests and can be unreliable on
+  # systems under a heavy load.
+
   def test_from_port(self):
     """
     Basic sanity check for the from_port constructor.
@@ -177,9 +181,10 @@ class TestController(unittest.TestCase):
     with runner.get_tor_controller() as controller:
       controller.add_event_listener(listener, EventType.BW)
 
-      # get a BW event or two
+      # Get a BW event or two. These should be emitted each second but under
+      # heavy system load that's not always the case.
 
-      event_notice.wait(2)
+      event_notice.wait(4)
       self.assertTrue(len(event_buffer) >= 1)
 
       # disconnect and check that we stop getting events
@@ -196,7 +201,7 @@ class TestController(unittest.TestCase):
       controller.connect()
       controller.authenticate(password = test.runner.CONTROL_PASSWORD)
 
-      event_notice.wait(2)
+      event_notice.wait(4)
       self.assertTrue(len(event_buffer) >= 1)
 
       # disconnect
@@ -210,7 +215,7 @@ class TestController(unittest.TestCase):
       controller.connect()
       stem.connection.authenticate(controller, password = test.runner.CONTROL_PASSWORD)
 
-      event_notice.wait(2)
+      event_notice.wait(4)
       self.assertTrue(len(event_buffer) >= 1)
 
       # disconnect
@@ -232,7 +237,7 @@ class TestController(unittest.TestCase):
         else:
           controller.msg('AUTHENTICATE')
 
-        event_notice.wait(2)
+        event_notice.wait(4)
         self.assertTrue(len(event_buffer) >= 1)
 
   def test_getinfo(self):

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