From cb8577d2248eaf1904808b99ada565e51e1ad8a1 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Wed, 5 Aug 2026 14:52:08 +0300 Subject: [PATCH] Fix flaky streams e2e tests caused by cron routines running in test servers --- app/entry.server.tsx | 3 ++- e2e/global-setup.ts | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/entry.server.tsx b/app/entry.server.tsx index d0f6084c9..1b7129426 100644 --- a/app/entry.server.tsx +++ b/app/entry.server.tsx @@ -21,6 +21,7 @@ import { everyTwoMinutes, } from "./routines/list.server"; import { loadAllDateFnsLocales } from "./utils/dates"; +import { IS_E2E_TEST_RUN } from "./utils/e2e"; import { logger } from "./utils/logger"; // Reject/cancel all pending promises after 5 seconds @@ -89,7 +90,7 @@ declare global { var appStartSignal: undefined | true; } -if (!global.appStartSignal && ServerConfig.isProduction) { +if (!global.appStartSignal && ServerConfig.isProduction && !IS_E2E_TEST_RUN) { global.appStartSignal = true; cron.schedule("0 */1 * * *", async () => { diff --git a/e2e/global-setup.ts b/e2e/global-setup.ts index c6f50b37a..9a34a112e 100644 --- a/e2e/global-setup.ts +++ b/e2e/global-setup.ts @@ -243,6 +243,10 @@ async function globalSetup(config: FullConfig) { // no system messages to a shared skalop instance (see build env above) SKALOP_SYSTEM_MESSAGE_URL: "", SKALOP_TOKEN: "", + // creds from .env must not reach test servers (SyncLiveStreams would + // hit the real Twitch API and overwrite factory-seeded streams) + TWITCH_CLIENT_ID: "", + TWITCH_CLIENT_SECRET: "", // tests assert webhook payloads by listening on the worker's webhook port SQ_CANCEL_DISCORD_WEBHOOK_URL: `http://localhost:${e2eWebhookPort(i)}/sq-cancel`, },