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): 20s timeout for the MAX_LOG_ENTRIES prune test (#4443)

LearningCircuit2f522c71d456
diff --git a/changelog.d/+logpanel-prune-test-timeout-headroom.misc.md b/changelog.d/+logpanel-prune-test-timeout-headroom.misc.md
new file mode 100644
index 0000000000..bde91707ad
--- /dev/null
+++ b/changelog.d/+logpanel-prune-test-timeout-headroom.misc.md
@@ -0,0 +1 @@
+Tests: give the logpanel ``prunes the oldest entries when count exceeds MAX_LOG_ENTRIES`` vitest case an explicit 20s timeout. #4304 fixed the real root cause (501 ``setTimeout(autoscroll, 0)`` tasks piling on the real timer queue) by faking all timers, but the test's remaining cost is honest O(n²) DOM work — 501 inserts each running ``addLogEntryToPanel``'s full-container ``querySelectorAll`` scans, ~2.6–2.9s in happy-dom on a dev machine — leaving no headroom against the 5s vitest default under parallel CI load. The recurring timeout flake intermittently failed the shared "All Pytest Tests + Coverage" job on unrelated PRs (e.g. #4415). The test must fill to the real 500-entry cap to exercise the prune, so the work can't shrink; a bigger budget is now the right lever (unlike #4299, which proposed it while the timer bug was still live).
diff --git a/tests/js/components/logpanel.test.js b/tests/js/components/logpanel.test.js
index f5d12a560f..e307b01e3d 100644
--- a/tests/js/components/logpanel.test.js
+++ b/tests/js/components/logpanel.test.js
@@ -412,7 +412,18 @@ describe('addLog / loadLogs — ordering invariants', () => {
]);
});
- it('prunes the oldest entries when count exceeds MAX_LOG_ENTRIES', () => {
+ // Explicit timeout: this test is genuinely heavy, not hung. 501 inserts
+ // each run addLogEntryToPanel's full-container querySelectorAll scans
+ // (dedup window, chronological insert position, prune check) — O(n²)
+ // DOM work that takes ~2.6-2.9s in happy-dom on a dev machine, so the
+ // 5s vitest default leaves no headroom under parallel CI load. #4304
+ // already fixed the *timer* pileup (501 real setTimeout(autoscroll, 0)
+ // tasks) by faking all timers; what remains is honest compute, so a
+ // bigger budget is the right lever now — unlike #4299, which proposed
+ // it while the timer bug was still the root cause. The test must fill
+ // to the real MAX_LOG_ENTRIES cap to exercise the prune, so the work
+ // can't be reduced without weakening the assertion.
+ it('prunes the oldest entries when count exceeds MAX_LOG_ENTRIES', { timeout: 20000 }, () => {
const container = document.getElementById('console-log-container');
// One insert over the cap. The live-insert prune in