commit e9dfc890a4f465817e9a46a61ca492f7c4dadcfa Author: kudrom kudrom@riseup.net Date: Fri Aug 22 16:00:14 2014 +0200
The measurement timeout now can be set by a nettest --- ooni/nettests/blocking/bridge_reachability.py | 6 ------ ooni/tasks.py | 5 ++++- 2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/ooni/nettests/blocking/bridge_reachability.py b/ooni/nettests/blocking/bridge_reachability.py index efe0b7b..9957430 100644 --- a/ooni/nettests/blocking/bridge_reachability.py +++ b/ooni/nettests/blocking/bridge_reachability.py @@ -49,12 +49,6 @@ class BridgeReachability(nettest.NetTestCase): self.tor_progress = 0 self.timeout = int(self.localOptions['timeout'])
- if self.timeout > config.advanced.measurement_timeout: - log.err("The measurement timeout is less than the bridge reachability test timeout") - log.err("Adjust your ooniprobe.conf file by setting the " - "advanced: measurement_timeout: value to %d" % self.timeout) - raise errors.InvalidConfigFile("advanced->measurement_timeout < %d" % self.timeout) - self.report['error'] = None self.report['success'] = None self.report['timeout'] = self.timeout diff --git a/ooni/tasks.py b/ooni/tasks.py index a869254..f2f4f75 100644 --- a/ooni/tasks.py +++ b/ooni/tasks.py @@ -113,7 +113,10 @@ class Measurement(TaskWithTimeout):
self.netTestMethod = getattr(self.testInstance, test_method)
- if config.advanced.measurement_timeout: + if 'timeout' in dir(test_instance): + if isinstance(test_instance.timeout, int) or isinstance(test_instance.timeout, float): + self.timeout = test_instance.timeout + elif config.advanced.measurement_timeout: self.timeout = config.advanced.measurement_timeout TaskWithTimeout.__init__(self)
tor-commits@lists.torproject.org