Commit df49e91b authored by Marius Gedminas's avatar Marius Gedminas

Try to fix test error on winbot

Instead of waiting for five arbitrary log messages let's wait for at
least two particular log messages, since the intent of this test is to
show that we're getting at least two of those.
parent 36031760
...@@ -1148,22 +1148,17 @@ def client_has_newer_data_than_server(): ...@@ -1148,22 +1148,17 @@ def client_has_newer_data_than_server():
>>> _, admin = start_server(addr=addr) >>> _, admin = start_server(addr=addr)
>>> for i in range(1000): >>> wait_until('got enough errors', lambda:
... while len(handler.records) < 5: ... len([x for x in handler.records
... time.sleep(.01)
>>> db.close()
>>> client_errors = [x for x in handler.records
... if x.filename == 'ClientStorage.py' and ... if x.filename == 'ClientStorage.py' and
... x.funcName == 'verify_cache' and ... x.funcName == 'verify_cache' and
... x.levelname == 'CRITICAL' and ... x.levelname == 'CRITICAL' and
... x.msg == 'client Client has seen ' ... x.msg == 'client Client has seen '
... 'newer transactions than server!'] ... 'newer transactions than server!']) >= 2)
>>> len(client_errors) >= 2
True
Note that the errors repeat because the client keeps on trying to connect. Note that the errors repeat because the client keeps on trying to connect.
>>> db.close()
>>> handler.uninstall() >>> handler.uninstall()
>>> stop_server(admin) >>> stop_server(admin)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment