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

[tor-commits] [ooni-probe/master] Set the measurement timeout to the timeout of the nettest + 8 to avoid triggering the measurement timeout before the nettest one.



commit ba2a9f6c9d3276994d3a8f315541ae49297dd355
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Sat Sep 13 21:00:27 2014 -0400

    Set the measurement timeout to the timeout of the nettest + 8 to avoid triggering the measurement timeout before the nettest one.
---
 ooni/tasks.py |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ooni/tasks.py b/ooni/tasks.py
index 650e0b0..9d281ab 100644
--- a/ooni/tasks.py
+++ b/ooni/tasks.py
@@ -118,7 +118,11 @@ class Measurement(TaskWithTimeout):
 
         if 'timeout' in dir(test_instance):
             if isinstance(test_instance.timeout, int) or isinstance(test_instance.timeout, float):
-                self.timeout = test_instance.timeout
+                # If the test has a timeout option set we set the measurement
+                # timeout to that value + 8 seconds to give it enough time to
+                # trigger it's internal timeout before we start trigger the
+                # measurement timeout.
+                self.timeout = test_instance.timeout + 8
         elif config.advanced.measurement_timeout:
             self.timeout = config.advanced.measurement_timeout
         TaskWithTimeout.__init__(self)



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