Skip to content

sockets: Add tests for tcp/{connect, listen, send,receive}#208

Open
saulecabrera wants to merge 4 commits intoWebAssembly:mainfrom
saulecabrera:sockets-send-receive-tests
Open

sockets: Add tests for tcp/{connect, listen, send,receive}#208
saulecabrera wants to merge 4 commits intoWebAssembly:mainfrom
saulecabrera:sockets-send-receive-tests

Conversation

@saulecabrera
Copy link
Contributor

@saulecabrera saulecabrera commented Jan 22, 2026

See individual commits for details.

This commit covers the `connect` functionality. The following cases:

* `timeout`
* `connection-{reset, aborted, unreachable}`

are tricky to similuate without the networking counterpart in the
host; I'm intentionally leaving these out from this patch and will be
included in follow-ups.

This commit also introduces a shared `sockets` module, to ease the
development of other sockets-related tests
https://github.com/WebAssembly/wasi-testsuite/pull/205/changes will be
rebased on top of this chnage once it lands.
@saulecabrera saulecabrera changed the title Add tests for tcp/{send,receive} sockets: Add tests for tcp/{send,receive} Jan 22, 2026
@saulecabrera saulecabrera force-pushed the sockets-send-receive-tests branch from 9f54653 to fbbeae3 Compare January 22, 2026 19:32
@saulecabrera saulecabrera changed the title sockets: Add tests for tcp/{send,receive} sockets: Add tests for tcp/{connect, listen, send,receive} Jan 22, 2026
@saulecabrera
Copy link
Contributor Author

cc @wingo I've decided to group all the other PRs into this one, to make easier to review (and update), every change is clearly separated into its own commit anyway. So I'll go ahead and close the others.

);
assert_eq!(next.get_keep_alive_count(), sock.get_keep_alive_count());
assert_eq!(next.get_hop_limit(), sock.get_hop_limit());
// TODO: In wasmtime, these values are different, even though according to the
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have to investigate a bit more prior to creating an issue upstream. See spec: https://github.com/WebAssembly/WASI/blob/main/proposals/sockets/wit-0.3.0-draft/types.wit#L239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant