Commit af8ef326

af8ef3269ec4Merged

Ori Pekelman <[email protected]> · 5 months ago · 3 files · +2 added · ~1 modified

Description

test: WebSocket-frame regression for the FFI :binstr return mode (#1466)

ac1e0d2c added the :binstr FFI return mode so binary payloads with embedded NUL bytes survive (the :str mode strlen-truncates). This pins the motivating case: an inbound (masked) WebSocket "subscribe" frame whose ActionCable payload exceeds 125 bytes, so the WS extended 2-byte length field is used -- its high byte is 0x00 (lengths 126..255) at frame index 2. Under :str the frame is truncated there (the server never reaches the masking key or payload); under :binstr every byte survives and the payload unmasks exactly.

Deterministic and POSIX-portable: the frame is delivered through shell_capture (a printf of octal escapes), the same channel ffi_binstr_recv.rb / sp_net_basic use, so the .expected holds on Linux + macOS CI. This guards the :binstr FFI lowering itself; the live sp_net_recv_some socket path is covered by the consumer suites (tep) and the repro on #1466. Filtered out on Windows like the other sp_net test (the TU is stubbed there).

Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]

Details

Commit
af8ef3269ec4
Parent
bfbcb5589663

MakefilemodifiedView file

@@ -280,7 +280,7 @@
280280 # sp_net is POSIX-only; on Windows the TU compiles to stubs and the smoke
281281 # test's output diverges. Skip it there.
282282 ifeq ($(OS),Windows_NT)
283-TESTS := $(filter-out test/sp_net_basic.rb,$(TESTS))
283+TESTS := $(filter-out test/sp_net_basic.rb test/ffi_binstr_ws_frame.rb,$(TESTS))
284284 endif
285285 TEST_TARGETS := $(patsubst test/%.rb,build/test-results/%.ok,$(TESTS))
286286