fix: wire slack deps and stabilize sigterm test
This commit is contained in:
@@ -2,6 +2,7 @@ import { sendMessageDiscord } from "../discord/send.js";
|
||||
import { sendMessageIMessage } from "../imessage/send.js";
|
||||
import { logWebSelfId, sendMessageWhatsApp } from "../providers/web/index.js";
|
||||
import { sendMessageSignal } from "../signal/send.js";
|
||||
import { sendMessageSlack } from "../slack/send.js";
|
||||
import { sendMessageTelegram } from "../telegram/send.js";
|
||||
|
||||
export type CliDeps = {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { spawn } from "node:child_process";
|
||||
import fs from "node:fs";
|
||||
import net from "node:net";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
|
||||
const waitForPortOpen = async (
|
||||
@@ -72,8 +75,11 @@ describe("gateway SIGTERM", () => {
|
||||
child = null;
|
||||
});
|
||||
|
||||
it("exits 0 on SIGTERM", { timeout: 60_000 }, async () => {
|
||||
it("exits 0 on SIGTERM", { timeout: 90_000 }, async () => {
|
||||
const port = await getFreePort();
|
||||
const stateDir = fs.mkdtempSync(
|
||||
path.join(os.tmpdir(), "clawdis-gateway-test-"),
|
||||
);
|
||||
const out: string[] = [];
|
||||
const err: string[] = [];
|
||||
|
||||
@@ -94,6 +100,8 @@ describe("gateway SIGTERM", () => {
|
||||
cwd: process.cwd(),
|
||||
env: {
|
||||
...process.env,
|
||||
CLAWDIS_STATE_DIR: stateDir,
|
||||
CLAWDIS_CONFIG_PATH: path.join(stateDir, "clawdis.json"),
|
||||
CLAWDIS_SKIP_PROVIDERS: "1",
|
||||
CLAWDIS_SKIP_BROWSER_CONTROL_SERVER: "1",
|
||||
CLAWDIS_SKIP_CANVAS_HOST: "1",
|
||||
@@ -113,7 +121,7 @@ describe("gateway SIGTERM", () => {
|
||||
child.stdout?.on("data", (d) => out.push(String(d)));
|
||||
child.stderr?.on("data", (d) => err.push(String(d)));
|
||||
|
||||
await waitForPortOpen(proc, out, err, port, 45_000);
|
||||
await waitForPortOpen(proc, out, err, port, 75_000);
|
||||
|
||||
proc.kill("SIGTERM");
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import { getQueueSize } from "../process/command-queue.js";
|
||||
import { webAuthExists } from "../providers/web/index.js";
|
||||
import { defaultRuntime, type RuntimeEnv } from "../runtime.js";
|
||||
import { sendMessageSignal } from "../signal/send.js";
|
||||
import { sendMessageSlack } from "../slack/send.js";
|
||||
import { sendMessageTelegram } from "../telegram/send.js";
|
||||
import { normalizeE164 } from "../utils.js";
|
||||
import { getActiveWebListener } from "../web/active-listener.js";
|
||||
|
||||
Reference in New Issue
Block a user