Skip to content

Commit

Permalink
Add retry for flush enable test, remove old eventual consistency retr…
Browse files Browse the repository at this point in the history
…y in update test
  • Loading branch information
Matt-Woz committed May 2, 2024
1 parent ffc463d commit 01db037
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions tests/BucketManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,13 @@ public function testCreateBucketFlushEnable()
$result = $this->manager->getBucket($this->bucketName);
$this->assertTrue($result->flushEnabled());

$this->manager->flush($this->bucketName);
$this->retryFor(
5,
100,
function () {
$this->manager->flush($this->bucketName);
}
);
}

public function testCreateBucketFlushNotEnabled()
Expand Down Expand Up @@ -277,19 +283,6 @@ function ($response) {
}
);

$manager = $this->manager;
$bucketName = $this->bucketName;
$result = $this->retryFor(
10,
1000,
function () use ($manager, $bucketName) {
$result = $manager->getBucket($bucketName);
if ($result->maxExpiry() == 5) {
throw new RuntimeException("the bucket still has old maxExpiry, retrying");
}
}
);

$result = $this->manager->getBucket($this->bucketName);
$this->assertEquals(10, $result->maxExpiry());
}
Expand Down

0 comments on commit 01db037

Please sign in to comment.