Skip to content

Commit

Permalink
Clarify an assertion message
Browse files Browse the repository at this point in the history
  • Loading branch information
jzbrooks committed Oct 2, 2023
1 parent 3ee1d98 commit 652bcab
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import com.google.protobuf.empty
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.channels.ReceiveChannel
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
import okhttp3.OkHttpClient
Expand Down Expand Up @@ -360,13 +361,13 @@ class Conformance(
}
val stream = client.streamingOutputCall()
withContext(Dispatchers.IO) {
val job = async {
val job = launch {
try {
val result = streamResults(stream.resultChannel())
assertThat(result.cause).isInstanceOf(ConnectException::class.java)
val exception = result.cause as ConnectException
assertThat(exception.code).isEqualTo(Code.DEADLINE_EXCEEDED)
assertThat(result.code).isEqualTo(Code.DEADLINE_EXCEEDED)
assertThat(result.code)
.withFailMessage { "Expected Code.DEADLINE_EXCEEDED but got ${result.code}" }
.isEqualTo(Code.DEADLINE_EXCEEDED)
} finally {
countDownLatch.countDown()
}
Expand Down

0 comments on commit 652bcab

Please sign in to comment.