Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel tests #66

Closed
sergiu128 opened this issue Apr 23, 2023 · 2 comments
Closed

Parallel tests #66

sergiu128 opened this issue Apr 23, 2023 · 2 comments

Comments

@sergiu128
Copy link
Collaborator

sergiu128 commented Apr 23, 2023

We currently run all tests sequentially because we bind to the same set of ports throughout different tests. We can run the tests in parallel if we bind the sockets to port 0 - that would force the kernel to automatically assign the next free port for the socket.

@sergiu128
Copy link
Collaborator Author

sergiu128 commented Nov 28, 2024

@MaxMaeder for websocket I realize we can make a neater interface after seeing the portChan. We could do something like:

srv := &MockServer{}
go func() {
    srv.Accept()
}()
wsurl := fmt.Sprintf("localhost:%d", <-srv.PortChan)

So we can have portChan as a member of MockServer. Then once we receive on this channel it is guaranteed that there's a listener waiting for connections. This means we can also get rid of the time.Sleeps - those were there to make sure the listener instantiates before we try to connect with a client.

@sergiu128 sergiu128 removed their assignment Nov 28, 2024
@sergiu128
Copy link
Collaborator Author

done in #149

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

No branches or pull requests

1 participant