Skip to content

Conversation

catamorphism
Copy link
Collaborator

Add two test programs, sockets-client.c and sockets-server.c, that are run by the test driver as separate executables (since without threads, this can't be written as a single test).

@catamorphism
Copy link
Collaborator Author

I'm not sure why the tests are failing in CI; everything works for me locally. I'll keep investigating.

@catamorphism catamorphism marked this pull request as draft September 12, 2025 01:27
@catamorphism
Copy link
Collaborator Author

The Makefile logic isn't right (although that doesn't explain why the tests fail); working on it.

 Add two test programs, sockets-client.c and sockets-server.c, that
 are run by the test driver as separate executables (since without
 threads, this can't be written as a single test).
@catamorphism catamorphism marked this pull request as ready for review September 12, 2025 03:00
Copy link
Collaborator

@pchickey pchickey left a comment

Choose a reason for hiding this comment

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

Thanks! We should test deeper when we get more time - want to see a server handle multiple connections in an accept loop to give coverage of poll(2) or select(2), hangups on either side, and nonblocking sockets - but this fixes the major deficiency of a smoke test.

@dicej when you have time - how can we reproduce the testing you performed on p2 sockets when that first landed?

@catamorphism catamorphism merged commit 4877d44 into WebAssembly:main Sep 12, 2025
16 checks passed
@dicej
Copy link
Contributor

dicej commented Sep 12, 2025

@dicej when you have time - how can we reproduce the testing you performed on p2 sockets when that first landed?

https://github.com/dicej/wasi-sockets-tests contains various smoke tests. I also relied heavily on CPython's suite of asyncio socket tests (ignoring the failures due to things like process forking, multithreading, and signal handling, which we don't have in WASI). I confess I don't recall the details of how I ran that test suite, though; I'd have to dig through my shell history or rediscover the incantations; happy to do that if it would be helpful.

@pavelsavara
Copy link

dotnet mono also has good WASIp2 coverage for sockets, but our CI for it is currently broken and we are behind on WASI-SDK upgrades.

We only care for async/non-blocking. That allows us to play role of the server and client in the same app.

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.

4 participants