Skip to content

Commit

Permalink
Remove time from test.
Browse files Browse the repository at this point in the history
  • Loading branch information
henningandersen committed Jan 30, 2024
1 parent 1db01a5 commit 976e7f7
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,6 @@ public void execute(Runnable command) {
return generic;
}
};
final AtomicLong relativeTimeInMillis = new AtomicLong(0L);
try (
NodeEnvironment environment = new NodeEnvironment(settings, TestEnvironment.newEnvironment(settings));
var cacheService = new SharedBlobCacheService<>(
Expand Down Expand Up @@ -980,7 +979,6 @@ public void execute(Runnable command) {
final PlainActionFuture<Collection<Boolean>> future = new PlainActionFuture<>();
final var listener = new GroupedActionListener<>(remainingFreeRegions, future);
for (int region = 0; region < remainingFreeRegions; region++) {
relativeTimeInMillis.addAndGet(1_000L);
cacheService.maybeFetchRegion(
cacheKey,
region,
Expand Down Expand Up @@ -1017,9 +1015,6 @@ public void execute(Runnable command) {
assertThat("Region already exists in cache", future.get(), is(false));
}
{
// simulate elapsed time and compute decay
var minInternalMillis = SharedBlobCacheService.SHARED_CACHE_MIN_TIME_DELTA_SETTING.getDefault(Settings.EMPTY).millis();
relativeTimeInMillis.addAndGet(minInternalMillis * 2);
cacheService.computeDecay();

// fetch one more region should evict an old cache entry
Expand Down

0 comments on commit 976e7f7

Please sign in to comment.