Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

test(logpanel): fix flaky MAX_LOG_ENTRIES prune test by faking all timers (#4304)

LearningCircuitd0ee5a85b94d
diff --git a/tests/js/components/logpanel.test.js b/tests/js/components/logpanel.test.js
index 251afd7c3a..f5d12a560f 100644
--- a/tests/js/components/logpanel.test.js
+++ b/tests/js/components/logpanel.test.js
@@ -336,11 +336,18 @@ describe('addLog / loadLogs — ordering invariants', () => {
beforeEach(() => {
// Drive entries through addLogEntryToPanel rather than the queue.
window._logPanelState.expanded = true;
- // Fake only Date so setTimeout(autoscroll, 0) keeps working.
- vi.useFakeTimers({ toFake: ['Date'] });
+ // Fake all timers — addLogEntryToPanel queues a setTimeout(autoscroll, 0)
+ // per call. Under parallel vitest load the prune test (501 calls)
+ // would pile up 501 real-timer tasks and time out at 5s. The tests
+ // here assert DOM contents, not scroll behavior, so leaving the
+ // autoscroll setTimeouts queued (unflushed) is intentional.
+ vi.useFakeTimers();
});
afterEach(() => {
+ // Drop any queued autoscroll setTimeouts before switching back to
+ // real timers, so they don't leak into a subsequent test.
+ vi.clearAllTimers();
vi.useRealTimers();
// Vitest isolates globals between files, but ordering changes
// within this file should not expose latent reliance on a prior