diff --git a/tests/auth_test.ts b/tests/auth_test.ts index 8b0df042..9b1684ce 100644 --- a/tests/auth_test.ts +++ b/tests/auth_test.ts @@ -1119,8 +1119,6 @@ Deno.test("auth - ignore auth error abort", async () => { Deno.test("auth - sub with permission error discards", async () => { const { ns, nc } = await setup({ - debug: true, - trace: true, authorization: { users: [{ user: "a", @@ -1132,7 +1130,7 @@ Deno.test("auth - sub with permission error discards", async () => { }, }], }, - }, { user: "a", pass: "a", debug: true }); + }, { user: "a", pass: "a" }); const nci = nc as NatsConnectionImpl; diff --git a/tests/authenticator_test.ts b/tests/authenticator_test.ts index 4c3ba278..5cdb7159 100644 --- a/tests/authenticator_test.ts +++ b/tests/authenticator_test.ts @@ -384,6 +384,8 @@ Deno.test("authenticator - creds fn", async () => { }, 2000); await cycle; + await nc.flush(); + assertEquals(nc.isClosed(), false); await cleanup(ns, nc); }); diff --git a/tests/jetstream_test.ts b/tests/jetstream_test.ts index 4c756dc6..a715a790 100644 --- a/tests/jetstream_test.ts +++ b/tests/jetstream_test.ts @@ -2289,7 +2289,7 @@ Deno.test("jetstream - source", async () => { await cleanup(ns, nc); }); -Deno.test("jestream - nak delay", async () => { +Deno.test("jetstream - nak delay", async () => { const { ns, nc } = await setup(jetstreamServerConf({}, true)); if (await notCompatible(ns, nc, "2.7.1")) { return; @@ -2873,12 +2873,9 @@ Deno.test("jetstream - bind", async () => { `unable to bind - durable consumer hello doesn't exist in ${stream}`, undefined, ); - - nc.subscribe("$JS.API.CONSUMER.DURABLE.CREATE.>", { - callback: (_err, _msg) => { - // this will count - }, - }); + // the rejection happens and the unsub is scheduled, but it is possible that + // the server didn't process it yet - flush to make sure the unsub was seen + await nc.flush(); opts.bind(stream, "me"); const sub = await js.subscribe(subj, opts); @@ -3322,7 +3319,7 @@ Deno.test("jetstream - ephemeral pull consumer", async () => { await nc.flush(); const jsm = await nc.jetstreamManager(); - await delay(1000); + await delay(1500); await assertRejects( async () => { await jsm.consumers.info(stream, old.name); @@ -3857,7 +3854,6 @@ Deno.test("jetstream - fetch on stopped server doesn't close client", async () = (async () => { let reconnects = 0; for await (const s of nc.status()) { - console.log(s); switch (s.type) { case DebugEvents.Reconnecting: reconnects++; diff --git a/tests/service_test.ts b/tests/service_test.ts index a6cbcf66..b1f63135 100644 --- a/tests/service_test.ts +++ b/tests/service_test.ts @@ -754,8 +754,9 @@ Deno.test("service - cross platform service test", async () => { ]; const p = Deno.run({ cmd: args, stderr: "piped", stdout: "piped" }); - const [status, stderr] = await Promise.all([ + const [status, _stdout, stderr] = await Promise.all([ p.status(), + p.output(), p.stderrOutput(), ]);