Skip to content

Commit

Permalink
Merge branch 'main' into os-timeout
Browse files Browse the repository at this point in the history
# Conflicts:
#	tests/service_test.ts
  • Loading branch information
aricart committed Jan 12, 2023
2 parents 7407be2 + c8d0410 commit 86f08f7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
4 changes: 1 addition & 3 deletions tests/auth_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions tests/authenticator_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@ Deno.test("authenticator - creds fn", async () => {
}, 2000);

await cycle;
await nc.flush();

assertEquals(nc.isClosed(), false);
await cleanup(ns, nc);
});
14 changes: 5 additions & 9 deletions tests/jetstream_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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++;
Expand Down
3 changes: 2 additions & 1 deletion tests/service_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
]);

Expand Down

0 comments on commit 86f08f7

Please sign in to comment.