Skip to content

Commit

Permalink
fix: prevent illegal negative timeout values into thread sleep() meth…
Browse files Browse the repository at this point in the history
…od while retrying exceptions in unit tests.

* For details on issue see - googleapis#2206
  • Loading branch information
arpan14 committed Feb 8, 2023
1 parent d566613 commit 8588fe1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ public void testTransactionManager() throws InterruptedException {
break;
}
} catch (AbortedException e) {
Thread.sleep(e.getRetryDelayInMillis());
long retryDelayInMillis = e.getRetryDelayInMillis();
if (retryDelayInMillis > 0) {
Thread.sleep(retryDelayInMillis);
}
txn = manager.resetForRetry();
}
}
Expand Down

0 comments on commit 8588fe1

Please sign in to comment.