Fix flaky streams e2e tests caused by cron routines running in test servers

This commit is contained in:
Kalle
2026-08-05 14:52:08 +03:00
parent 353d24d2ad
commit cb8577d224
2 changed files with 6 additions and 1 deletions

View File

@@ -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 () => {

View File

@@ -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`,
},