Skip to content

Commit e096c39

Browse files
committed
tests: ensure memcache is cleared in MemcachedTest
1 parent a71f5a0 commit e096c39

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/Ackintosh/Ganesha/Storage/Adapter/MemcachedTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,9 @@ public function outdatedCountsShouldBeEvictedInCaseOfRateStrategy(): void
413413
->intervalToHalfOpen(10)
414414
->build();
415415

416+
// Ensure memcache is cleared
417+
sleep(1);
418+
416419
// Record successes.
417420
// Since Memcached adapter implements `TumblingTimeWindow`, the count is recorded into a key which based on timestamp.
418421
$serviceName = 'outdatedCountsShouldBeEvicted';
@@ -441,8 +444,8 @@ public function outdatedCountsShouldBeEvictedInCaseOfRateStrategy(): void
441444
(int)$this->memcached->get($failureKeyForTheTumblingTimeWindow)
442445
);
443446

444-
// Since sleeping 15 seconds as below, the `TumblingTimeWindow` contains the success count recorded above is outdated.
445-
sleep(15);
447+
// Since sleeping 10 seconds as below, the `TumblingTimeWindow` contains the success count recorded above is outdated.
448+
sleep(10);
446449

447450
// The count should be got cleared as the `TumblingTimeWindow` is outdated at this point.
448451
self::assertFalse($this->memcached->get($successKeyForTheTumblingTimeWindow));

0 commit comments

Comments
 (0)