use of com.palantir.atlasdb.transaction.api.TransactionLockTimeoutNonRetriableException in project atlasdb by palantir.
the class SnapshotTransactionTest method noRetryOnExpiredLockTokens.
@Test
public void noRetryOnExpiredLockTokens() throws InterruptedException {
HeldLocksToken expiredLockToken = getExpiredHeldLocksToken();
try {
txManager.runTaskWithLocksWithRetry(ImmutableList.of(expiredLockToken), () -> null, (tx, locks) -> {
tx.put(TABLE, ImmutableMap.of(TEST_CELL, PtBytes.toBytes("value")));
return null;
});
fail();
} catch (TransactionLockTimeoutNonRetriableException e) {
Set<LockRefreshToken> expectedTokens = ImmutableSet.of(expiredLockToken.getLockRefreshToken());
assertThat(e.getMessage(), containsString(expectedTokens.toString()));
assertThat(e.getMessage(), containsString("Retry is not possible."));
}
}
Aggregations