Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmetmircik committed May 3, 2021
1 parent f8cb33f commit d8a3a41
Showing 1 changed file with 5 additions and 6 deletions.
Expand Up @@ -344,8 +344,7 @@ public void testExpirationTime_whenMaxIdleTime_isSmallerThan_TTL() {
map.put(1, 1, 100, TimeUnit.SECONDS);

EntryView<Integer, Integer> entryView = map.getEntryView(1);
long lastAccessTime = entryView.getLastAccessTime();
long delayToExpiration = lastAccessTime + TimeUnit.SECONDS.toMillis(10);
long delayToExpiration = TimeUnit.SECONDS.toMillis(10);

// lastAccessTime is zero after put, we can find expiration by this calculation
long expectedExpirationTime = delayToExpiration + entryView.getCreationTime();
Expand All @@ -367,14 +366,14 @@ public void testExpirationTime_whenMaxIdleTime_isBiggerThan_TTL() {
}

@Test
public void testLastAccessTime_isZero_afterFirstPut() {
public void testLastAccessTime_equals_creationTime_afterFirstPut() {
IMap<Integer, Integer> map = createMap();

map.put(1, 1);

EntryView<Integer, Integer> entryView = map.getEntryView(1);

assertEquals(0L, entryView.getLastAccessTime());
assertEquals(entryView.getCreationTime(), entryView.getLastAccessTime());
}

@Test
Expand Down Expand Up @@ -438,9 +437,9 @@ public void last_access_time_updated_on_primary_when_read_backup_data_enabled()

long lastAccessTimeBefore = map.getEntryView(1).getLastAccessTime();

sleepAtLeastMillis(10);
sleepAtLeastMillis(500);
map.get(1);
sleepAtLeastMillis(10);
sleepAtLeastMillis(500);
map.get(1);

long lastAccessTimeAfter = map.getEntryView(1).getLastAccessTime();
Expand Down

0 comments on commit d8a3a41

Please sign in to comment.