Skip to content

Commit

Permalink
Increase expiration times to avoid false positives on unit tests (#13781
Browse files Browse the repository at this point in the history
)
  • Loading branch information
tkountis committed Sep 17, 2018
1 parent 56d5ea0 commit 277f7e8
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,25 @@ public void testExpirationTime_withTTL() {
public void testExpirationTime_withTTL_withShorterMaxIdle() {
IMap<Integer, Integer> map = createMap();

map.put(1, 1, ONE_MINUTE_IN_MILLIS, MILLISECONDS, 3, SECONDS);
map.put(1, 1, ONE_MINUTE_IN_MILLIS, MILLISECONDS, 10, SECONDS);

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

long expectedExpirationTime = creationTime + SECONDS.toMillis(3);
long expectedExpirationTime = creationTime + SECONDS.toMillis(10);
assertEquals(expectedExpirationTime, entryView.getExpirationTime());
}

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

map.put(1, 1, 2, SECONDS, 10, SECONDS);
map.put(1, 1, 10, SECONDS, 20, SECONDS);

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

long expectedExpirationTime = creationTime + SECONDS.toMillis(2);
long expectedExpirationTime = creationTime + SECONDS.toMillis(10);
assertEquals(expectedExpirationTime, entryView.getExpirationTime());
}

Expand Down Expand Up @@ -355,7 +355,6 @@ private IMap<Integer, Integer> createMapWithTTLSeconds(int ttlSeconds) {
@SuppressWarnings("SameParameterValue")
private static long getExpirationTime(IMap<Integer, Integer> map, int key) {
EntryView<Integer, Integer> entryView = map.getEntryView(key);
System.out.println(entryView.toString());
return entryView.getExpirationTime();
}
}

0 comments on commit 277f7e8

Please sign in to comment.