Commit 9912f7f
committed
grpc: Run test servers on unused ports
By setting the port to 0 we will end up letting the kernel choose
the port. We need to call the new s.listen method so that the code
running in the main test goroutine won't race with s.port = 0 or
s.port = $kernelProvidedPort that happens in s.listen.
This ends up fixing a flaky test setup that is *super* hard to reproduce.
The flaky test was first seen in Nahum's branch converting CI from
drone -> GitHubActions, and only when running `make test` followed by
`make coverage`, which seemed to run into the TCP port possibly being
in SHUTDOWN still. Seems like the GHA runner does not have the kernel
tweaked for this.1 parent b29b40e commit 9912f7f
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
198 | 200 | | |
199 | 201 | | |
200 | 202 | | |
| |||
0 commit comments