mirror of
https://github.com/storytold/craft-libs.git
synced 2026-12-01 10:48:15 +01:00
The CUPS deadline reader and the lpstat output limit read the time from a clock the caller passes (the real clock in production), so the tests move time by hand instead of waiting on it: - A trickling peer that moves the clock 20 ms per byte gets timeouts of 80, 60, 40 and 20 ms, then TimedOut, for reads and for writes. - A stalled unix peer's socket waits exactly the time left. - A closed unix peer's buffered reply is read on a clock that does not move, and the read at the deadline fails with TimedOut. - A hanging lpstat -e is stopped at its limit, and the printer it would name 30 s later is not listed. - The second CUPS endpoint is stopped after serving every earlier connection, and its request channel is empty. The print helper child reports each stage on a loopback connection and waits there to be released, in place of polled marker files.