Skip to content

Commit 0810169

Browse files
committed
test: remove unnecessary retry loop in listRetiredResources
1 parent bec2c2d commit 0810169

1 file changed

Lines changed: 6 additions & 22 deletions

File tree

kms/test/kmsTest.php

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -866,29 +866,13 @@ public function testDeleteCryptoKey()
866866
*/
867867
public function testListRetiredResources($deletedKeyId)
868868
{
869-
// Add retry logic for eventual consistency
870-
$attempts = 0;
871-
$found = false;
872-
873-
while ($attempts < 10 && !$found) {
874-
// runFunctionSnippet captures output already.
875-
list(, $output) = $this->runFunctionSnippet('list_retired_resources', [
876-
self::$projectId,
877-
self::$locationId
878-
]);
879-
880-
if (strpos($output, $deletedKeyId) !== false) {
881-
$found = true;
882-
$this->assertStringContainsString('Retired Resource Name', $output);
883-
} else {
884-
sleep(1);
885-
$attempts++;
886-
}
887-
}
869+
list(, $output) = $this->runFunctionSnippet('list_retired_resources', [
870+
self::$projectId,
871+
self::$locationId
872+
]);
888873

889-
if (!$found) {
890-
$this->fail("Did not find deleted key $deletedKeyId in retired resources list.");
891-
}
874+
$this->assertStringContainsString('Retired Resource Name', $output);
875+
$this->assertStringContainsString($deletedKeyId, $output);
892876
}
893877

894878
/**

0 commit comments

Comments
 (0)