diff --git a/changelog.d/19870.misc b/changelog.d/19870.misc new file mode 100644 index 00000000000..83760993ca1 --- /dev/null +++ b/changelog.d/19870.misc @@ -0,0 +1 @@ +Stub. diff --git a/tests/unittest.py b/tests/unittest.py index 93131521d03..b31012ccb9e 100644 --- a/tests/unittest.py +++ b/tests/unittest.py @@ -734,7 +734,12 @@ def pump(self, by: float = 0.0) -> None: # second steps/increments. We assume this was done so that when you use the # clock to schedule something that schedules more things, it tries to run the # whole chain to completion. - self.reactor.pump([by] * 100) + for _ in range(100): + self.reactor.advance(by) + # Allow other threads to make progress. This is real sleep time so we don't + # want to actually sleep for the same amount of time someone wants to + # advance the Twisted clock for. + time.sleep(0) def get_success(self, d: Awaitable[TV], by: float = 0.0) -> TV: deferred: Deferred[TV] = ensureDeferred(d) # type: ignore[arg-type]