Skip to content

A thread safe way to take a free port#485

Merged
JekaMas merged 12 commits into
developfrom
net-port-data-race
Aug 16, 2022
Merged

A thread safe way to take a free port#485
JekaMas merged 12 commits into
developfrom
net-port-data-race

Conversation

@JekaMas
Copy link
Copy Markdown
Contributor

@JekaMas JekaMas commented Aug 4, 2022

This PR provides a common function to find available port during tests and to avoid usage of conflicting ports in tests (which caused a lot of them to fail un-deterministically).

Moreover, to be more deterministic in case of GRPC server, it directly propagates the net.Listener object for port safety.

It also adds server options while creating server which is useful for tests.

Comment thread internal/cli/server/server.go
Comment thread internal/cli/server/server.go
@manav2401 manav2401 requested a review from a team August 16, 2022 11:30
@JekaMas JekaMas merged commit 3c94dfb into develop Aug 16, 2022
@manav2401 manav2401 deleted the net-port-data-race branch August 17, 2022 06:04
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.

3 participants