interop-testing: Improve failure messages for ping_ping

Timeouts and Status returns can be common, and previously those cases
weren't that clear. For example, if there was a StatusRuntimeException
it would just print the status code and message, but not the causal
chain.
This commit is contained in:
Eric Anderson 2018-03-07 13:28:41 -08:00 committed by GitHub
parent ae1fb9467c
commit ca7b3dad11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -703,8 +703,12 @@ public abstract class AbstractInteropTest {
for (int i = 0; i < requests.size(); i++) {
assertNull(queue.peek());
requestObserver.onNext(requests.get(i));
assertEquals(goldenResponses.get(i),
queue.poll(operationTimeoutMillis(), TimeUnit.MILLISECONDS));
Object actualResponse = queue.poll(operationTimeoutMillis(), TimeUnit.MILLISECONDS);
assertNotNull("Timed out waiting for response", actualResponse);
if (actualResponse instanceof Throwable) {
throw new AssertionError((Throwable) actualResponse);
}
assertEquals(goldenResponses.get(i), actualResponse);
}
requestObserver.onCompleted();
assertEquals("Completed", queue.poll(operationTimeoutMillis(), TimeUnit.MILLISECONDS));