Hi,
I have a problem with running integration tests in parallel which I solved and I just wanted to notify you about the problem. It seems like the grpcmock is shared between tests. (Atleast in the way I am using it)
When I run tests in parallel I will get an error with the port being taken.
I found the following in your code and it turns out that the socket.setReuseAddress(true); in findFreePort is what is causing the issue, so by removing it is resolved.
private static int findFreePort() {
try (ServerSocket socket = new ServerSocket(0)) {
return socket.getLocalPort();
} catch (IOException e) {
throw new GrpcMockException("Failed finding a free port", e);
}
}
Hi, I have a problem with running integration tests in parallel which I solved and I just wanted to notify you about the problem. It seems like the grpcmock is shared between tests. (Atleast in the way I am using it)
I am unable to use the
@AutoConfigureGrpcMock
since I am using the starter from https://github.com/yidongnan/grpc-spring-boot-starter and need to set the address via@DynamicPropertySource
like this:I start the server like this:
When I run tests in parallel I will get an error with the port being taken.
I found the following in your code and it turns out that the
socket.setReuseAddress(true);
infindFreePort
is what is causing the issue, so by removing it is resolved.