Skip to content

Commit

Permalink
Use real value rather than mock for flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
larry-safran committed Feb 2, 2024
1 parent c8844f3 commit 991fb7d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public class RetryTest {
public final GrpcCleanupRule cleanupRule = new GrpcCleanupRule();
private final FakeClock fakeClock = new FakeClock();
private TestListener realMockCallListener = new TestListener();
@SuppressWarnings("unchecked")
private ClientCall.Listener<Integer> mockCallListener =
mock(ClientCall.Listener.class, delegatesTo(realMockCallListener));

Expand Down Expand Up @@ -546,9 +547,10 @@ public ClientStreamTracer newClientStreamTracer(StreamInfo info, Metadata header
assertRetryStatsRecorded(0, 1, 0);
}

private class TestListener extends ClientCall.Listener<Integer> {
private static class TestListener extends ClientCall.Listener<Integer> {
Status status = null;
private CountDownLatch closeLatch = new CountDownLatch(1);

@Override
public void onClose(Status status, Metadata trailers) {
this.status = status;
Expand Down

0 comments on commit 991fb7d

Please sign in to comment.