mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 17:04:58 +00:00
test(subagent-announce): fix flaky Windows-only test failure (#31298) (openclaw#31370) thanks @zwffff
Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check (fails on main baseline issues in extensions/googlechat and extensions/phone-control) - pnpm test:e2e src/agents/subagent-announce.format.e2e.test.ts Co-authored-by: zwffff <5809959+zwffff@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -147,8 +147,13 @@ describe("subagent announce formatting", () => {
|
||||
let runSubagentAnnounceFlow: (typeof import("./subagent-announce.js"))["runSubagentAnnounceFlow"];
|
||||
|
||||
beforeAll(async () => {
|
||||
({ runSubagentAnnounceFlow } = await import("./subagent-announce.js"));
|
||||
// Set FAST_TEST_MODE before importing the module to ensure the module-level
|
||||
// constant picks it up. This fixes flaky Windows CI failures where the test
|
||||
// timeout budget is too tight without fast mode enabled.
|
||||
// See: https://github.com/openclaw/openclaw/issues/31298
|
||||
previousFastTestEnv = process.env.OPENCLAW_TEST_FAST;
|
||||
process.env.OPENCLAW_TEST_FAST = "1";
|
||||
({ runSubagentAnnounceFlow } = await import("./subagent-announce.js"));
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
@@ -160,7 +165,8 @@ describe("subagent announce formatting", () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
vi.stubEnv("OPENCLAW_TEST_FAST", "1");
|
||||
// OPENCLAW_TEST_FAST is set in beforeAll before module import
|
||||
// to ensure the module-level constant picks it up.
|
||||
agentSpy
|
||||
.mockClear()
|
||||
.mockImplementation(async (_req: AgentCallRequest) => ({ runId: "run-main", status: "ok" }));
|
||||
|
||||
Reference in New Issue
Block a user