mirror of https://github.com/grpc/grpc-java.git
interop client: fix soak test bug where we can crash if peer wasn't set
This commit is contained in:
parent
4cb1fbaa9f
commit
267d15412f
|
|
@ -2054,12 +2054,12 @@ public abstract class AbstractInteropTest {
|
||||||
.withInterceptors(recordClientCallInterceptor(clientCallCapture));
|
.withInterceptors(recordClientCallInterceptor(clientCallCapture));
|
||||||
}
|
}
|
||||||
SoakIterationResult result = performOneSoakIteration(soakStub);
|
SoakIterationResult result = performOneSoakIteration(soakStub);
|
||||||
String peer = clientCallCapture
|
SocketAddress peer = clientCallCapture
|
||||||
.get().getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR).toString();
|
.get().getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR);
|
||||||
System.err.print(
|
System.err.print(
|
||||||
String.format(
|
String.format(
|
||||||
"soak iteration: %d elapsed_ms: %d peer: %s",
|
"soak iteration: %d elapsed_ms: %d peer: %s",
|
||||||
i, result.getLatencyMs(), peer));
|
i, result.getLatencyMs(), peer != null ? peer.toString() : "null"));
|
||||||
if (!result.getStatus().equals(Status.OK)) {
|
if (!result.getStatus().equals(Status.OK)) {
|
||||||
totalFailures++;
|
totalFailures++;
|
||||||
System.err.println(String.format(" failed: %s", result.getStatus()));
|
System.err.println(String.format(" failed: %s", result.getStatus()));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue