mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-05-17 08:26:56 +03:00
test: add retry logic to flaky external service tests
External services like smtp.gmail.com and xmpp.earth can be unreliable in CI environments. Added retry logic (up to 3 attempts) to prevent false test failures due to network issues.
This commit is contained in:
@@ -239,10 +239,13 @@ describe("TCP Monitor", () => {
|
||||
status: PENDING,
|
||||
};
|
||||
|
||||
await assert.rejects(
|
||||
tcpMonitor.check(monitor, heartbeat, {}),
|
||||
/Expected TLS alert 'certificate_required' but connection succeeded/
|
||||
);
|
||||
// Retry with backoff for external service reliability, expecting rejection
|
||||
await retryExternalService(async () => {
|
||||
await assert.rejects(
|
||||
tcpMonitor.check(monitor, heartbeat, {}),
|
||||
/Expected TLS alert 'certificate_required' but connection succeeded/
|
||||
);
|
||||
}, heartbeat);
|
||||
});
|
||||
|
||||
test("parseTlsAlertNumber() extracts alert number from error message", async () => {
|
||||
|
||||
Reference in New Issue
Block a user