[TEST] Lower deleteInterval in TokenAuthIntegTests

We run subsequent token invalidation requests and we still want to
trigger the deletion of expired tokens so we need to lower the
deleteInterval parameter significantly. Especially now that the
bwc expiration logic is removed and the invalidation process is
much shorter

Resolves #37063
This commit is contained in:
Ioannis Kakavas 2019-01-02 23:50:55 +02:00
parent d4e7660248
commit f0cd19f39b
1 changed files with 4 additions and 4 deletions

View File

@ -54,7 +54,7 @@ public class TokenAuthIntegTests extends SecurityIntegTestCase {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
// crank up the deletion interval and set timeout for delete requests
.put(TokenService.DELETE_INTERVAL.getKey(), TimeValue.timeValueSeconds(1L))
.put(TokenService.DELETE_INTERVAL.getKey(), TimeValue.timeValueMillis(200L))
.put(TokenService.DELETE_TIMEOUT.getKey(), TimeValue.timeValueSeconds(5L))
.put(XPackSettings.TOKEN_SERVICE_ENABLED_SETTING.getKey(), true)
.build();
@ -160,10 +160,10 @@ public class TokenAuthIntegTests extends SecurityIntegTestCase {
});
// hack doc to modify the creation time to the day before
Instant dayBefore = created.minus(1L, ChronoUnit.DAYS);
assertTrue(Instant.now().isAfter(dayBefore));
Instant yesterday = created.minus(36L, ChronoUnit.HOURS);
assertTrue(Instant.now().isAfter(yesterday));
client.prepareUpdate(SecurityIndexManager.SECURITY_INDEX_NAME, "doc", docId.get())
.setDoc("creation_time", dayBefore.toEpochMilli())
.setDoc("creation_time", yesterday.toEpochMilli())
.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)
.get();