Skip to content

Commit

Permalink
Fix potential case where the tests would wait forever (#2875)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin committed Jan 14, 2021
1 parent 0359580 commit 3821047
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -83,7 +83,7 @@ class ApolloCancelCallTest {
val start = System.currentTimeMillis()
while (true) {
val timeoutMillis = TimeUnit.MILLISECONDS.convert(timeoutDuration, unit) - (System.currentTimeMillis() - start)
if (timeoutMillis < 0) {
if (timeoutMillis <= 0) {
throw TimeoutException("Timeout reached")
}
if (completed) {
Expand Down Expand Up @@ -127,7 +127,7 @@ class ApolloCancelCallTest {
val start = System.currentTimeMillis()
while (true) {
val timeoutMillis = TimeUnit.MILLISECONDS.convert(timeoutDuration, unit) - (System.currentTimeMillis() - start)
if (timeoutMillis < 0) {
if (timeoutMillis <= 0) {
throw TimeoutException("Timeout reached")
}
if (completed) {
Expand Down

0 comments on commit 3821047

Please sign in to comment.