Skip to content

Commit e4ea8c5

Browse files
committed
Adjust fast forward for token expiration test (#30668)
Adjust fast forward for token expiration test Adjusts the maximum fast forward time for token expiration tests to be 5 seconds before actual token expiration so that the test won't fail even when upperlimit is randomly selected. Resolves: #30062
1 parent 6996f28 commit e4ea8c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenServiceTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ public void testTokenExpiry() throws Exception {
516516
}
517517

518518
final TimeValue defaultExpiration = TokenService.TOKEN_EXPIRATION.get(Settings.EMPTY);
519-
final int fastForwardAmount = randomIntBetween(1, Math.toIntExact(defaultExpiration.getSeconds()));
519+
final int fastForwardAmount = randomIntBetween(1, Math.toIntExact(defaultExpiration.getSeconds()) - 5);
520520
try (ThreadContext.StoredContext ignore = requestContext.newStoredContext(true)) {
521521
// move the clock forward but don't go to expiry
522522
clock.fastForwardSeconds(fastForwardAmount);

0 commit comments

Comments
 (0)