diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2017-06-23 09:52:06 -0700 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2017-06-23 09:52:06 -0700 |
commit | 6491fdcd035d05feee3f5e7d8f3d46aec37fb8ec (patch) | |
tree | a539cbdfbe1960ea1154fefa664184eb144edd25 /tests | |
parent | 7b20150ca23d8ce6e325799dbf735d26dfd0f03e (diff) |
Import s3ql_2.22+dfsg.orig.tar.gz
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mock_server.py | 18 | ||||
-rwxr-xr-x | tests/t1_backends.py | 2 |
2 files changed, 1 insertions, 19 deletions
diff --git a/tests/mock_server.py b/tests/mock_server.py index c63c54b..135cb64 100644 --- a/tests/mock_server.py +++ b/tests/mock_server.py @@ -13,7 +13,6 @@ import socketserver import logging import hashlib import urllib.parse -import sys import traceback from xml.sax.saxutils import escape as xml_escape @@ -46,23 +45,6 @@ class StorageServer(socketserver.TCPServer): self.hostname = self.server_address[0] self.port = self.server_address[1] - def serve_forever(self): - # This is a hack to debug sporadic test failures due to exceptions in - # the mock server thread. So far, I have not managed to properly debug - # them because reproducing them is very difficult, and output capture - # for some reason only gets the first line of the traceback. My current - # best theory is that these exceptions just happen at some point during - # cleanup (after the test has passed), and are therefore safe to ignore - # ( because any actual problems should also cause test failures in the - # main thread that runs the actual test). However, it's better to be - # safe than sorry - try: - super().serve_forever() - except Exception: - with open('mock_server.log', 'r+') as fh: - traceback.print_exc(file=fh) - raise - class ParsedURL: __slots__ = [ 'bucket', 'key', 'params', 'fragment' ] diff --git a/tests/t1_backends.py b/tests/t1_backends.py index 8ae7c56..290446b 100755 --- a/tests/t1_backends.py +++ b/tests/t1_backends.py @@ -220,8 +220,8 @@ def yield_mock_backend(bi): yield backend finally: backend.close() - server.server_close() server.shutdown() + server.server_close() def yield_remote_backend(bi, _ctr=[0]): # Add timestamp + ctr to prefix so we don't have to deal with cruft from |