jetty.project
jetty.project copied to clipboard
Flaky test ServletTest.testSimpleIdleRead()
Jetty version(s) 12+
Jetty Environment ee10
Description See #10945.
The problem is as follows:
The last request does not send the content, so the Servlet is blocked in a read.
The idle timeout fires, and runs the demand callback, which reads the failure, which wakes up the blocked by throwing, which is then caught and handled in ServletChannel.handleException(), resulting in a sendError() that succeeds.
In the process above, however, we do not notify the underlying HttpStream that there was a failure.
So in case of HttpStreamOverHTTP1, the underlying EndPoint remains fill interested (because the request was waiting for content that was never sent).
When the sendError() completes successfully, HttpStreamOverHTTP1 is succeeded, where it checks if it was fill interested, finding that it was, and aborting with "read pending".
The test also erroneously send 11 bytes of data instead of 10, due to the extra \n after the 10 digits.