test: require active status before SLA breach
This commit is contained in:
@@ -84,6 +84,36 @@ test('fixture runner can invoke watchdog skeleton with a generated input file',
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
test('watchdog reports active before SLA when dispatch exists and no completion receipt has arrived yet', () => {
|
||||||
|
const runner = createFixtureRunner();
|
||||||
|
|
||||||
|
try {
|
||||||
|
const inputPath = runner.writeFixture('dispatch-before-sla.json', {
|
||||||
|
runId: 'fixture-run-active-before-sla',
|
||||||
|
childSessionKey: 'session:active-before-sla',
|
||||||
|
dispatchAt: '2026-04-24T10:00:00.000Z',
|
||||||
|
expectedBy: '2026-04-24T10:10:00.000Z',
|
||||||
|
currentTime: '2026-04-24T10:05:00.000Z',
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = runner.runWatchdog(['--compact', '--input', inputPath]);
|
||||||
|
|
||||||
|
assert.equal(result.status, 0, `expected zero exit status, got ${result.status}
|
||||||
|
${result.stderr}`);
|
||||||
|
assert.equal(result.stderr, '');
|
||||||
|
|
||||||
|
const payload = JSON.parse(result.stdout);
|
||||||
|
assert.equal(payload.ok, true);
|
||||||
|
assert.equal(payload.input.path, inputPath);
|
||||||
|
assert.equal(payload.input.exists, true);
|
||||||
|
assert.equal(payload.result.status, 'active');
|
||||||
|
} finally {
|
||||||
|
runner.cleanup();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
test('fixture runner exposes missing-input behavior for future fail-first cases', () => {
|
test('fixture runner exposes missing-input behavior for future fail-first cases', () => {
|
||||||
const runner = createFixtureRunner();
|
const runner = createFixtureRunner();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user