mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-24 17:16:21 -07:00
fix(stats): harden server lifecycle and verify compiled runtime (#261)
This commit is contained in:
@@ -406,6 +406,17 @@ test('handleCliCommand ensures background stats server for second-instance --sta
|
||||
assert.equal(ensured.length, 1);
|
||||
});
|
||||
|
||||
test('handleCliCommand reports unexpected background stats startup failures', async () => {
|
||||
const startup = Promise.reject(new Error('startup unavailable'));
|
||||
const { deps, calls, osd } = createDeps({ ensureBackgroundStatsServer: () => startup });
|
||||
|
||||
handleCliCommand(makeArgs({ start: true, background: true }), 'initial', deps);
|
||||
await new Promise((resolve) => setImmediate(resolve));
|
||||
|
||||
assert.ok(calls.includes('error:ensureBackgroundStatsServer failed:'));
|
||||
assert.ok(osd.includes('Stats server startup failed: startup unavailable'));
|
||||
});
|
||||
|
||||
test('handleCliCommand does not ensure background stats server for foreground --start', () => {
|
||||
const ensured: number[] = [];
|
||||
const { deps } = createDeps({
|
||||
|
||||
Reference in New Issue
Block a user