Skip to content

Commit 18f166e

Browse files
committed
Add sleep to avoid the rate limit for creating/deleting.
1 parent 3e7ef05 commit 18f166e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

storage/test/BucketLockCommandTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@ public static function setUpBeforeClass()
4040

4141
public function setUp()
4242
{
43+
// Sleep to avoid the rate limit for creating/deleting.
44+
sleep(5 + rand(2, 4));
4345
$application = require __DIR__ . '/../storage.php';
4446
$this->commandTester = new CommandTester($application->get('bucket-lock'));
4547
$this->storage = new StorageClient();
4648
if (!self::$hasCredentials) {
4749
$this->markTestSkipped('No application credentials were found.');
4850
}
4951

50-
# Append random because tests for multiple PHP versions were running at the same time.
52+
// Append random because tests for multiple PHP versions were running at the same time.
5153
$bucketName = 'php-bucket-lock-' . time() . '-' . rand(1000, 9999);
5254
$this->bucket = $this->storage->createBucket($bucketName);
5355
}

0 commit comments

Comments
 (0)