mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 22:58:50 +01:00
Merge branch 'maint-0.3.5'
This commit is contained in:
commit
1c47459e5a
2 changed files with 6 additions and 4 deletions
4
changes/ticket28883
Normal file
4
changes/ticket28883
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
o Minor bugfixes (testing):
|
||||||
|
- Make sure that test_rebind.py actually obeys its timeout, even
|
||||||
|
when it receives a large number of log messages. Fixes bug 28883;
|
||||||
|
bugfix on 0.3.5.4-alpha.
|
|
@ -11,7 +11,6 @@ import time
|
||||||
|
|
||||||
LOG_TIMEOUT = 60.0
|
LOG_TIMEOUT = 60.0
|
||||||
LOG_WAIT = 0.1
|
LOG_WAIT = 0.1
|
||||||
LOG_CHECK_LIMIT = LOG_TIMEOUT / LOG_WAIT
|
|
||||||
|
|
||||||
def fail(msg):
|
def fail(msg):
|
||||||
logging.error('FAIL')
|
logging.error('FAIL')
|
||||||
|
@ -26,8 +25,8 @@ def try_connecting_to_socksport():
|
||||||
socks_socket.close()
|
socks_socket.close()
|
||||||
|
|
||||||
def wait_for_log(s):
|
def wait_for_log(s):
|
||||||
log_checked = 0
|
cutoff = time.time() + LOG_TIMEOUT
|
||||||
while log_checked < LOG_CHECK_LIMIT:
|
while time.time() < cutoff:
|
||||||
l = tor_process.stdout.readline()
|
l = tor_process.stdout.readline()
|
||||||
l = l.decode('utf8')
|
l = l.decode('utf8')
|
||||||
if s in l:
|
if s in l:
|
||||||
|
@ -38,7 +37,6 @@ def wait_for_log(s):
|
||||||
# avoid busy-waiting
|
# avoid busy-waiting
|
||||||
if len(s) == 0:
|
if len(s) == 0:
|
||||||
time.sleep(LOG_WAIT)
|
time.sleep(LOG_WAIT)
|
||||||
log_checked += 1
|
|
||||||
fail('Could not find "{}" in logs after {} seconds'.format(s, LOG_TIMEOUT))
|
fail('Could not find "{}" in logs after {} seconds'.format(s, LOG_TIMEOUT))
|
||||||
|
|
||||||
def pick_random_port():
|
def pick_random_port():
|
||||||
|
|
Loading…
Add table
Reference in a new issue