Fix timeout in parallel benchmark.

This commit is contained in:
Itamar Turner-Trauring 2023-02-21 09:57:21 -05:00
parent 154f1ce143
commit 2811c80dc3
2 changed files with 9 additions and 1 deletions

View File

@ -74,6 +74,10 @@ class ImmutableBenchmarks(SystemTestMixin, TestCase):
# To use Foolscap, change to True:
FORCE_FOOLSCAP_FOR_STORAGE = False
# Don't reduce HTTP connection timeouts, that messes up the more aggressive
# benchmarks:
REDUCE_HTTP_CLIENT_TIMEOUT = False
@async_to_deferred
async def setUp(self):
SystemTestMixin.setUp(self)

View File

@ -681,6 +681,9 @@ class SystemTestMixin(pollmixin.PollMixin, testutil.StallMixin):
# test code.
FORCE_FOOLSCAP_FOR_STORAGE : Optional[bool] = None
# If True, reduce the timeout on connections:
REDUCE_HTTP_CLIENT_TIMEOUT : bool = True
def setUp(self):
self._http_client_pools = []
http_client.StorageClient.start_test_mode(self._got_new_http_connection_pool)
@ -707,7 +710,8 @@ class SystemTestMixin(pollmixin.PollMixin, testutil.StallMixin):
d.addTimeout(1, reactor)
return d
pool.getConnection = getConnectionWithTimeout
if self.REDUCE_HTTP_CLIENT_TIMEOUT:
pool.getConnection = getConnectionWithTimeout
def close_idle_http_connections(self):
"""Close all HTTP client connections that are just hanging around."""