From 01db03733366d3ef1b1279cc1b1190cbca43b3a7 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Thu, 2 May 2024 11:57:50 +0100 Subject: [PATCH] Add retry for flush enable test, remove old eventual consistency retry in update test --- tests/BucketManagerTest.php | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/tests/BucketManagerTest.php b/tests/BucketManagerTest.php index cd3b9114..3d7a4e06 100644 --- a/tests/BucketManagerTest.php +++ b/tests/BucketManagerTest.php @@ -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() @@ -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()); }