Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: scale mediaJobQueue test's waitFor budget for CI (#7516)

[._.]/ Adam Eivy047fbc86c396
diff --git a/server/services/mediaJobQueue/index.test.js b/server/services/mediaJobQueue/index.test.js
index 9b68989bdc..9e62b40c0f 100644
--- a/server/services/mediaJobQueue/index.test.js
+++ b/server/services/mediaJobQueue/index.test.js
@@ -1741,7 +1741,13 @@ describe('mediaJobQueue unreadable snapshot (#4115)', () => {
// genuinely broken predicate stays diagnosable instead of becoming an
// anonymous 3-second stall. No predicate here uses expect(), so a real
// assertion failure cannot be downgraded into a timeout by the catch.
-async function waitFor(predicate, { timeoutMs = 3000, intervalMs = 30 } = {}) {
+// CI's default budget is scaled up here, in the one helper every call site
+// shares — a cold spawn plus filesystem work through an AV filter driver on a
+// shared Windows runner routinely exceeds the budget that's generous on a
+// developer machine (#7516). A call site that needs a longer budget for a
+// real reason should say so locally via `timeoutMs`, not rely on this default.
+const DEFAULT_WAIT_MS = process.env.CI ? 15000 : 3000;
+async function waitFor(predicate, { timeoutMs = DEFAULT_WAIT_MS, intervalMs = 30 } = {}) {
const deadline = Date.now() + timeoutMs;
let lastError = null;
for (;;) {