Skip to content

Commit 35fa934

Browse files
authored
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 3dfa93e commit 35fa934

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
@@ -450,7 +450,7 @@ public void testTokenExpiry() throws Exception {
450450
}
451451

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

0 commit comments

Comments
 (0)