Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Commit ce66098

Browse files
author
Arpan Mishra
authored
fix: prevent illegal negative timeout values into thread sleep() method while retrying exceptions in unit tests. (#2268)
* fix: prevent illegal negative timeout values into thread sleep() method while retrying exceptions in unit tests. * For details on issue see - #2206
1 parent fa8edb3 commit ce66098

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITClosedSessionTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,10 @@ public void testTransactionManager() throws InterruptedException {
251251
break;
252252
}
253253
} catch (AbortedException e) {
254-
Thread.sleep(e.getRetryDelayInMillis());
254+
long retryDelayInMillis = e.getRetryDelayInMillis();
255+
if (retryDelayInMillis > 0) {
256+
Thread.sleep(retryDelayInMillis);
257+
}
255258
txn = manager.resetForRetry();
256259
}
257260
}

0 commit comments

Comments
 (0)