diff --git a/benchmarks/upload_download.py b/benchmarks/upload_download.py index 0ca034af9..3dfa63336 100644 --- a/benchmarks/upload_download.py +++ b/benchmarks/upload_download.py @@ -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) diff --git a/src/allmydata/test/common_system.py b/src/allmydata/test/common_system.py index 01966824a..39b2b43d1 100644 --- a/src/allmydata/test/common_system.py +++ b/src/allmydata/test/common_system.py @@ -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."""