mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-10 04:46:07 -08:00
fix(stats): harden server lifecycle and verify compiled runtime (#261)
This commit is contained in:
1 parent
f9c4e892dc
commit
383aed8bad
37 files changed
+1381
-323
No files matched your search
@@ -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