Skip to content

Commit

Permalink
fix: force messages to be provessed slowly to ensure topology
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-pousette committed Dec 14, 2023
1 parent 12a203a commit 8a2b69e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/transport/stream/src/__tests__/stream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,14 @@ describe("streams", function () {
});

it("messages are only sent once to each peer", async () => {
streams.forEach((stream) => {
const processFn = stream.stream.processMessage.bind(stream.stream);
stream.stream.processMessage = async (a, b, c) => {
await delay(200);
return processFn(a, b, c);
};
});

let totalWrites = 10;
expect(streams[0].ack).toHaveLength(0);

Expand Down

0 comments on commit 8a2b69e

Please sign in to comment.