diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-12-19 15:36:08 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-12-19 15:36:08 -0500 |
commit | 1c47459e5a5ed6d404a8034502543e7e4a67be38 (patch) | |
tree | 45729e96545bf1de13e046fe4b92ecc57e78a76c /src/test/test_rebind.py | |
parent | ed0bc85ed0ac765c91def249afa1390bd03cfe85 (diff) | |
parent | b7018b1a24fbdaed2805e11b0343e03445f8cb7e (diff) | |
download | tor-1c47459e5a5ed6d404a8034502543e7e4a67be38.tar.gz tor-1c47459e5a5ed6d404a8034502543e7e4a67be38.zip |
Merge branch 'maint-0.3.5'
Diffstat (limited to 'src/test/test_rebind.py')
-rw-r--r-- | src/test/test_rebind.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/test/test_rebind.py b/src/test/test_rebind.py index 7d0ccaf628..65feedd243 100644 --- a/src/test/test_rebind.py +++ b/src/test/test_rebind.py @@ -11,7 +11,6 @@ import time LOG_TIMEOUT = 60.0 LOG_WAIT = 0.1 -LOG_CHECK_LIMIT = LOG_TIMEOUT / LOG_WAIT def fail(msg): logging.error('FAIL') @@ -26,8 +25,8 @@ def try_connecting_to_socksport(): socks_socket.close() def wait_for_log(s): - log_checked = 0 - while log_checked < LOG_CHECK_LIMIT: + cutoff = time.time() + LOG_TIMEOUT + while time.time() < cutoff: l = tor_process.stdout.readline() l = l.decode('utf8') if s in l: @@ -38,7 +37,6 @@ def wait_for_log(s): # avoid busy-waiting if len(s) == 0: time.sleep(LOG_WAIT) - log_checked += 1 fail('Could not find "{}" in logs after {} seconds'.format(s, LOG_TIMEOUT)) def pick_random_port(): |