This commit is contained in:
2025-05-23 20:40:20 +00:00
parent a7438a7cd6
commit f651cd1c2f
5 changed files with 73 additions and 275 deletions

View File

@ -255,6 +255,7 @@ tap.test('ErrorHandler should properly handle and format errors', async () => {
{
maxAttempts: 5,
baseDelay: 10, // Use small delay for tests
retryableErrorPatterns: [/Temporary failure/], // Add pattern to make error retryable
onRetry: (error, attempt, delay) => {
expect(error).toBeInstanceOf(PlatformError);
expect(attempt).toBeGreaterThan(0);
@ -277,7 +278,8 @@ tap.test('ErrorHandler should properly handle and format errors', async () => {
'TEST_RETRY_ERROR',
{
maxAttempts: 3,
baseDelay: 10
baseDelay: 10,
retryableErrorPatterns: [/Persistent failure/] // Make error retryable so it tries all attempts
}
);
} catch (error) {
@ -388,6 +390,7 @@ tap.test('Error handling can be combined with retry for robust operations', asyn
{
maxRetries: 2, // Only retry twice, but we need 5 attempts to succeed
initialDelay: 10,
retryableErrors: [/Flaky failure/] // Add pattern to make it retry
}
);
// Should not reach here