Skip to content

Commit

Permalink
S2AStub uses withWaitForReady.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmehta19 committed Sep 9, 2024
1 parent da330cd commit 655f0bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion s2a/src/main/java/io/grpc/s2a/handshaker/S2AStub.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ public void close() {
private void createWriterIfNull() {
if (writer == null) {
writer =
serviceStub.withDeadlineAfter(HANDSHAKE_RPC_DEADLINE_SECS, SECONDS).setUpSession(reader);
serviceStub
.withWaitForReady()
.withDeadlineAfter(HANDSHAKE_RPC_DEADLINE_SECS, SECONDS)
.setUpSession(reader);
}
}

Expand Down
2 changes: 1 addition & 1 deletion s2a/src/test/java/io/grpc/s2a/handshaker/S2AStubTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void send_receiveOkStatus() throws Exception {
IOException expected =
assertThrows(IOException.class, () -> newStub.send(SessionReq.getDefaultInstance()));

assertThat(expected).hasMessageThat().contains("UNAVAILABLE");
assertThat(expected).hasMessageThat().contains("DEADLINE_EXCEEDED");
}

@Test
Expand Down

0 comments on commit 655f0bd

Please sign in to comment.