Interrupt live traffic retry delays on stop
Build and Deploy Gateway / build-and-push (push) Successful in 1m58s
Build and Deploy Gateway / deploy (push) Successful in 19s

This commit is contained in:
2026-08-31 05:34:56 +03:00
parent bdf3f22b12
commit 79e00a2390
4 changed files with 53 additions and 21 deletions
+23
View File
@@ -223,6 +223,29 @@ for (const incompatible of [
});
}
test('collector stop interrupts an active retry delay', async () => {
const service = createLiveTrafficService({
port: 19091,
enabled: true,
isRuntimeRunning: () => true,
clientFactory: () => ({
async getVersion() { return { version: '1.13.18', apiVersion: 4 }; },
async getStartedAt() { throw new Error('must not start'); },
subscribeConnections() { throw new Error('must not subscribe'); },
subscribeStatus() { throw new Error('must not subscribe'); },
}),
});
service.start();
await waitFor(() => service.snapshot().source.state === 'incompatible');
await new Promise((resolve) => setImmediate(resolve));
const stoppedBeforeNextTurn = await Promise.race([
service.stop().then(() => true),
new Promise((resolve) => setImmediate(() => resolve(false))),
]);
assert.equal(stoppedBeforeNextTurn, true);
});
test('collector reconnects when either RC5 stream ends and cancels its sibling', async () => {
let factoryCalls = 0;
let authorizationCalls = 0;