Skip to content

Commit

Permalink
Add some logging on failed attemps
Browse files Browse the repository at this point in the history
  • Loading branch information
PROFeNoM committed Jan 17, 2025
1 parent cacd54d commit 2948eb7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/Common/IntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abstract class IntegrationTestCase extends BaseTestCase
public static $database = "test";
private static $createdDatabases = ["test" => true];

protected static $maxRetries = 3;
protected static $maxRetries = 5;

public static function ddSetUpBeforeClass()
{
Expand Down Expand Up @@ -124,8 +124,11 @@ protected function retryTest(callable $testCase, ...$args)
$testCase(...$args);
return; // Test passed, exit the loop.
} catch (\Throwable $e) {
echo "Attempt $attempts failed: " . $e->getMessage() . PHP_EOL;
echo "Retrying..." . PHP_EOL;
$attempts++;
if ($attempts >= self::$maxRetries) {
echo "Max retries reached." . PHP_EOL;
throw $e; // Re-throw after max retries.
}
}
Expand Down

0 comments on commit 2948eb7

Please sign in to comment.