Skip to content

Commit

Permalink
timeout tests seem to be flapping against demo, moving to local (#139)
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Ricart <alberto@synadia.com>
  • Loading branch information
aricart authored Nov 13, 2024
1 parent 76b6751 commit ab296de
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/tests/timeout_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@ import {
assertRejects,
assertStringIncludes,
} from "jsr:@std/assert";
import { connect } from "./connect.ts";
import { createInbox, Empty, errors } from "../src/internal_mod.ts";
import { cleanup, setup } from "../../test_helpers/mod.ts";

Deno.test("timeout - request noMux stack is useful", async () => {
const nc = await connect({ servers: "demo.nats.io" });
const { ns, nc } = await setup();
const subj = createInbox();
const err = await assertRejects(() => {
return nc.request(subj, Empty, { noMux: true, timeout: 250 });
}, errors.RequestError);
assertInstanceOf(err.cause, errors.NoRespondersError);
assertStringIncludes((err as Error).stack || "", "timeout_test");
await nc.close();
await cleanup(ns, nc);
});

Deno.test("timeout - request stack is useful", async () => {
const nc = await connect({ servers: "demo.nats.io" });
const { ns, nc } = await setup();
const subj = createInbox();
const err = await assertRejects(() => {
return nc.request(subj, Empty, { timeout: 250 });
}, errors.RequestError);
assertInstanceOf(err.cause, errors.NoRespondersError);
assertStringIncludes((err as Error).stack || "", "timeout_test");
await nc.close();
await cleanup(ns, nc);
});

0 comments on commit ab296de

Please sign in to comment.