mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-11-18 16:58:18 -06:00
Durable Object alarms are stopped after 15 minutes, and a full X-Rank or Splatfest rankings update can take longer than that: - RunLimits takes an optional deadline. X-Rank season details, Splatfest rankings, and the slow lane's updater loop stop starting new work once it passes and mark the run incomplete; what is left updates in a later run. The current X-Rank season goes first. - The slow lane runs with a 10-minute budget. An incomplete run is followed a minute later by a continuation (up to 10, never past the lane's next regular slot), which does not count as a retry. Manual runs continue the same way through a queued follow-up. - Ignore Wrangler's local secrets files (.dev.vars*). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
30 lines
753 B
JavaScript
30 lines
753 B
JavaScript
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
import RunLimits from './RunLimits.mjs';
|
|
|
|
describe('RunLimits', () => {
|
|
afterEach(() => {
|
|
vi.useRealTimers();
|
|
});
|
|
|
|
it('never runs out of time without a deadline', () => {
|
|
let limits = new RunLimits;
|
|
|
|
expect(limits.outOfTime()).toBe(false);
|
|
expect(limits.incomplete).toBe(false);
|
|
});
|
|
|
|
it('marks the run incomplete once the deadline passes', () => {
|
|
vi.useFakeTimers();
|
|
vi.setSystemTime(1000);
|
|
let limits = new RunLimits({ deadline: 2000 });
|
|
|
|
expect(limits.outOfTime()).toBe(false);
|
|
expect(limits.incomplete).toBe(false);
|
|
|
|
vi.setSystemTime(2000);
|
|
|
|
expect(limits.outOfTime()).toBe(true);
|
|
expect(limits.incomplete).toBe(true);
|
|
});
|
|
});
|