Tests: fix two CI flakes seen on main
CI / Lint (eslint) (pull_request) Successful in 27s
CI / Test (jest) (pull_request) Successful in 1m4s
CI / Security (npm audit) (pull_request) Successful in 39s
CI / Integration (api) (pull_request) Successful in 4m18s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 3m50s
CI / UI screenshots (before/after) (pull_request) Successful in 10s
CI / UI (playwright) (pull_request) Successful in 2m39s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (push) Skipped
CI / Test (jest) (push) Successful in 1m15s
CI / Lint (eslint) (push) Successful in 1m20s
CI / Security (npm audit) (push) Successful in 27s
CI / Integration (api) (push) Successful in 3m42s
CI / Scan (secrets, workflows, shell) (push) Successful in 3m11s
CI / UI (playwright) (push) Successful in 2m38s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Notify (push) Skipped

- calculateNextRun interval: bounded by the clock before and after the
  call (its first use loads cron-parser, which took 30 s once on a loaded
  runner and broke the fixed 1 s tolerance).
- Integration helper: retry a GET once when a pooled keep-alive connection
  is reset (ECONNRESET as the server closes it); writes are never retried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jaredandClaude Opus 5.5 committed 2026-11-23 00:57:53 -05:00
1 parent 1a031515e7
commit 6d289a3bce
2 files changed
+17 -3

No files matched your search

+5 -2
View File
@@ -123,10 +123,13 @@ describe('evalCondition', () => {
describe('calculateNextRun', () => {
test('interval: returns a date ~N minutes in the future', () => {
// Bounded by the clock before and after the call: its first use loads cron-parser,
// which took 30 s once on a loaded CI runner and broke a fixed 1 s tolerance.
const before = Date.now();
const result = calculateNextRun('interval', '30');
expect(result.getTime()).toBeGreaterThanOrEqual(before + 30 * 60000 - 100);
expect(result.getTime()).toBeLessThanOrEqual(before + 30 * 60000 + 1000);
const after = Date.now();
expect(result.getTime()).toBeGreaterThanOrEqual(before + 30 * 60000);
expect(result.getTime()).toBeLessThanOrEqual(after + 30 * 60000);
});
test('interval: throws on non-positive value', () => {