sabbey37 commented on a change in pull request #6325:
URL: https://github.com/apache/geode/pull/6325#discussion_r618721962
##########
File path:
geode-apis-compatible-with-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/server/AbstractHitsMissesIntegrationTest.java
##########
@@ -169,8 +169,9 @@ public void testExpire() {
@Test
public void testPassiveExpiration() {
runCommandAndAssertNoStatUpdates("hash", (k) -> {
- jedis.expire(k, PassiveExpirationManager.INTERVAL);
- GeodeAwaitility.await().during(Duration.ofSeconds(3)).until(() -> true);
+ jedis.expire(k, 1);
+
GeodeAwaitility.await().during(Duration.ofSeconds(PassiveExpirationManager.INTERVAL))
+ .until(() -> true);
Review comment:
`Duration.ofSeconds` should be `Duration.ofMinutes`.
Is there a reason we're not really checking that the key expires here?
We could, for example check the following:
```
GeodeAwaitility.await()
.atMost(Duration.ofMinutes(PassiveExpirationManager.INTERVAL + 1))
.until(() -> jedis.keys("hash").isEmpty());
```
...To make sure the key has actually expired before verifying the keyspace
hits and misses. I added 1 minute to the interval to avoid flakiness if
passive expiration just ran. Using `atMost` will also allow the test to move
on if the condition evaluates to true before the specified duration. The
`KEYS` command does not update keyspace hits/misses, so we can safely use that
to make sure the key has expired.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]