Skip to content

Commit

Permalink
flapping errors
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Ricart <[email protected]>
  • Loading branch information
aricart committed Oct 29, 2024
1 parent 1f55822 commit 980838b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
3 changes: 1 addition & 2 deletions core/tests/auth_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,7 @@ Deno.test("auth - bad auth is notified", async () => {
}
})().then();

await ns.stop();
ns = await ns.restart();
await nc.reconnect();

const err = await nc.closed();
assert(badAuths > 1);
Expand Down
17 changes: 4 additions & 13 deletions core/tests/basics_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1228,19 +1228,10 @@ Deno.test("basics - initial connect error", async () => {
}
})();

try {
await connect({ port, reconnect: false });
fail("shouldn't have connected");
} catch (err) {
console.log(err);
// in node we may get a disconnect which we generated
// in deno we get the connection reset - but if running in CI this may turn out to be
// a connection refused
assertArrayIncludes(["ECONNRESET", "CONNECTION_REFUSED"], [
//@ts-ignore: exception has code
err.code,
]);
}
await assertRejects(() => {
return connect({ port, reconnect: false });
}, Deno.errors.ConnectionReset);

listener.close();
await done;
});
Expand Down

0 comments on commit 980838b

Please sign in to comment.