From 451e68795cf5cfb02fabdf6baa870289b978a8f7 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Thu, 30 Jun 2022 13:54:58 -0400 Subject: [PATCH] Lints, better explanation. --- src/allmydata/test/test_storage_http.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/allmydata/test/test_storage_http.py b/src/allmydata/test/test_storage_http.py index 915cd33f2..3108ffae8 100644 --- a/src/allmydata/test/test_storage_http.py +++ b/src/allmydata/test/test_storage_http.py @@ -22,7 +22,6 @@ from base64 import b64encode from contextlib import contextmanager from os import urandom from typing import Union, Callable, Tuple, Iterable -from time import sleep, time from cbor2 import dumps from pycddl import ValidationError as CDDLValidationError from hypothesis import assume, given, strategies as st @@ -32,7 +31,6 @@ from klein import Klein from hyperlink import DecodedURL from collections_extended import RangeMap from twisted.internet.task import Clock, Cooperator -from twisted.internet import task from twisted.web import http from twisted.web.http_headers import Headers from werkzeug import routing @@ -370,6 +368,10 @@ class HttpTestFixture(Fixture): def _setUp(self): self.clock = Clock() self.tempdir = self.useFixture(TempDir()) + # The global Cooperator used by Twisted (a) used by pull producers in + # twisted.web, (b) is driven by a real reactor. We want to push time + # forward ourselves since we rely on pull producers in the HTTP storage + # server. self.mock = self.useFixture( MockPatch( "twisted.internet.task._theCooperator",