Skip to content

Commit

Permalink
fix: test add delay
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-pousette committed Dec 13, 2023
1 parent 07c80ee commit 410be43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/transport/pubsub/src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,8 @@ describe("pubsub", function () {
[session.peers[0], session.peers[2]]
]);

await delay(5000);

for (const [i, peer] of session.peers.entries()) {
await peer.services.pubsub.subscribe(TOPIC);
}
Expand Down Expand Up @@ -777,9 +779,6 @@ describe("pubsub", function () {
});

await delay(3000);
const a = streams.map((x) => x.stream.routes.routes.size);
const b = streams.map((x) => x.stream.routes.routes.size);
const c = streams.map((x) => x.stream.routes.routes.size);

streams[1].received = [];
streams[2].received = [];
Expand Down Expand Up @@ -1125,7 +1124,10 @@ describe("pubsub", function () {
() =>
!streams[2].stream.topics
.get(TOPIC_1)
?.has(streams[0].stream.publicKeyHash)
?.has(streams[0].stream.publicKeyHash),
{
timeout: 20 * 1000
}
);

expect(streams[2].subscriptionEvents).toHaveLength(1);
Expand Down
1 change: 1 addition & 0 deletions packages/transport/stream/src/__tests__/stream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ describe("streams", function () {
let totalWrites = 10;
expect(streams[0].ack).toHaveLength(0);

await delay(5000);
// push one message to ensure paths are found
await streams[0].stream.publish(data, {
mode: new SeekDelivery({
Expand Down

0 comments on commit 410be43

Please sign in to comment.