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));
|
||||
}
|
||||
SoakIterationResult result = performOneSoakIteration(soakStub);
|
||||
String peer = clientCallCapture
|
||||
.get().getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR).toString();
|
||||
SocketAddress peer = clientCallCapture
|
||||
.get().getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR);
|
||||
System.err.print(
|
||||
String.format(
|
||||
"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)) {
|
||||
totalFailures++;
|
||||
System.err.println(String.format(" failed: %s", result.getStatus()));
|
||||
|
|
|
|||
Loading…
Reference in New Issue