We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3f82bd commit 574622aCopy full SHA for 574622a
1 file changed
src/bref/tests/Lambda/LambdaClientTest.php
@@ -22,8 +22,26 @@ class LambdaClientTest extends TestCase
22
protected function setUp(): void
23
{
24
ob_start();
25
- sleep(5);
26
- Server::start();
+
+ $maxRetries = 5;
27
+ $attempt = 0;
28
+ while ($attempt < $maxRetries) {
29
+ try {
30
+ Server::start();
31
+ break;
32
+ } catch (\RuntimeException $runtimeException) {
33
+ if ('Unable to contact node.js server' !== $runtimeException->getMessage()) {
34
+ throw $runtimeException;
35
+ }
36
37
+ ++$attempt;
38
+ if ($attempt >= $maxRetries) {
39
40
41
+ \usleep(500000);
42
43
44
45
$this->lambda = new LambdaClient('localhost:8126', 'phpunit');
46
}
47
0 commit comments