test(fpc): gate WebSocket EAGAIN regression - #564
Conversation
Two standalone FPC programs covering transports the DUnitX suite cannot reach, since it is Delphi-only. Neither depends on a test framework, and each exits non-zero on failure. FPCHttpKeepaliveTest.dpr drives 30 sequential requests over one reused connection and asserts each completes within 35 ms. KeepConnection := True is required: TFPHTTPClient defaults it to False, and the stall only appears on a reused connection because Linux quickack makes the first ACK on every socket immediate. It refuses to build below FPC 3.3.1, where the provider's keep-alive and TCP_NODELAY code is not compiled at all. Verified against 3.3.4 on trunk: max 1 ms. tests/fpc-websocket/ covers the EAGAIN path on the epoll transport. It asserts SILENCE after the first EAGAIN rather than liveness, which is the distinction that catches the defect. 5/5 on FPC 3.2.2 against the reworked implementation in 3.3.4. Additive only: no existing file is modified except .gitignore, which gains two entries for FPC test binaries whose Linux builds have no extension.
|
Thank you for adding coverage for these FPC-specific paths. The WebSocket regression test was compiled and run with FPC 3.2.2 in Docker and all 5 checks passed. Before merging, could you please address the following points?
Issue #565 identifies a separate Windows/FPC gap: keep-alive is enabled there, while the |
regyssilveira
left a comment
There was a problem hiding this comment.
Validated after the maintainer follow-up: 5/5 checks pass on FPC 3.2.2 in Docker, the pre-fix control fails the three expected assertions, and the workflow passes actionlint. The duplicate keep-alive test was removed in favor of the existing authoritative CI regression.
Summary
Adds an FPC + epoll WebSocket regression test for the EAGAIN handling fixed in #549 and runs it in GitHub Actions with FPC 3.2.2.
The test opens a real WebSocket connection over the epoll provider and verifies that:
EAGAINdoes not resume the HTTP pipeline or emit a stray response;OnMessageand is echoed;Review adjustments
The maintainer follow-up commit makes the original contribution CI-ready:
.github/workflows/tests.yml;127.0.0.1;recvcalls;errnoonce before classifying EAGAIN/EWOULDBLOCK;FPCHttpKeepAliveServer.dpr+fpc_keepalive_regression.pypair as the authoritative keep-alive regression gate.Validation
37d699f(before the WebSocket fix): 2 passed, 3 failed, detecting the stray HTTP response, idle-connection violation, and missing echo;actionlint.