Grokking Concurrency in Python
0% completed
Testing Time Without Waiting
A retry policy that waits 1, 2 and then 4 seconds between attempts adds 1 + 2 + 4 = 7 seconds to any test of a fetch that succeeds only on its fourth attempt. A test of a 30-second deadline waits 30 seconds, and five requests through a limit of two per second need 2 seconds. These three tests alone would wait 39 seconds while doing almost no work.
Real sleeps make the suite slow, and asserting real elapsed times makes it fail when a CI machine is busy. Both problems disappear when the test controls the clock.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%