Skip to content

Commit

Permalink
[FIX] the change to the test exposed a error where the resource limit…
Browse files Browse the repository at this point in the history
…s of the test server were exceeded.
  • Loading branch information
aricart committed Mar 2, 2023
1 parent e5cb75f commit 37976ca
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/jetstream_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1944,15 +1944,27 @@ Deno.test("jetstream - idle heartbeats", async () => {
});

Deno.test("jetstream - flow control", async () => {
const { ns, nc } = await setup(jetstreamServerConf({}, true));
const { ns, nc } = await setup(jetstreamServerConf({
jetstream: {
max_file: -1,
},
}, true));
const { stream, subj } = await initStream(nc);
const data = new Uint8Array(1024 * 100);
const js = nc.jetstream();
const proms = [];
for (let i = 0; i < 2000; i++) {
proms.push(js.publish(subj, data));
nc.publish(subj, data);
if (proms.length % 100 === 0) {
await Promise.all(proms);
proms.length = 0;
}
}
await Promise.all(proms);
if (proms.length) {
await Promise.all(proms);
}
await nc.flush();

const jsm = await nc.jetstreamManager();
const inbox = createInbox();
Expand Down

0 comments on commit 37976ca

Please sign in to comment.