wasi-sockets: Align stream tests with current P3 spec#12600
Open
badeend wants to merge 7 commits intobytecodealliance:mainfrom
Open
wasi-sockets: Align stream tests with current P3 spec#12600badeend wants to merge 7 commits intobytecodealliance:mainfrom
badeend wants to merge 7 commits intobytecodealliance:mainfrom
Conversation
…ode::Unknown` because EPIPE is not mapped
Aside from `test_tcp_read_cancellation`, all other tests were ported directly from their P2 counterpart. However, many of those P2 tests were testing semantics that are not relevant in P3. For example, they were testing the interaction between the old `tcp-socket::shutdown` method and its effect of the input/output streams. In P3, `shutdown` is called automatically when the stream is dropped
…n operational even after the socket that spawned them has been dropped.
alexcrichton
approved these changes
Feb 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aside from
test_tcp_read_cancellation, all other P3 TCP stream tests were transliterated from their P2 counterpart. Some of those ex-P2 tests were testing the interaction between the oldtcp-socket::shutdownmethod and its effect of the input/output streams. In P3,shutdownis called automatically when the stream is dropped, so that test code is not really relevant in P3.This PR:
test_tcp_send_drops_stream_when_remote_shutdown: TheSendStreamConsumerdid not handleEPIPEcorrectly yet.test_tcp_stream_lifetimesto test the new behavior from Async write prevents Rust bindings and component composition WebAssembly/WASI#870test_tcp_receive_once&test_tcp_send_once. Becausetcp-socket::send/receivemay be called successfully at most once.Connected,Receiving&P2Streamingstates into one.