diff --git a/packages/tests/src/lib/service_node.ts b/packages/tests/src/lib/service_node.ts index 7006a8ad5a..cc269d98d8 100644 --- a/packages/tests/src/lib/service_node.ts +++ b/packages/tests/src/lib/service_node.ts @@ -29,7 +29,7 @@ const WAKU_SERVICE_NODE_PARAMS = const NODE_READY_LOG_LINE = "Node setup complete"; export const DOCKER_IMAGE_NAME = - process.env.WAKUNODE_IMAGE || "wakuorg/nwaku:v0.24.0"; + process.env.WAKUNODE_IMAGE || "wakuorg/nwaku:v0.25.0"; const isGoWaku = DOCKER_IMAGE_NAME.includes("go-waku"); diff --git a/packages/tests/src/run-tests.js b/packages/tests/src/run-tests.js index 91526189c0..107187e8be 100644 --- a/packages/tests/src/run-tests.js +++ b/packages/tests/src/run-tests.js @@ -3,7 +3,7 @@ import { promisify } from "util"; const execAsync = promisify(exec); -const WAKUNODE_IMAGE = process.env.WAKUNODE_IMAGE || "wakuorg/nwaku:v0.24.0"; +const WAKUNODE_IMAGE = process.env.WAKUNODE_IMAGE || "wakuorg/nwaku:v0.25.0"; async function main() { try { diff --git a/packages/tests/tests/filter/single_node/subscribe.node.spec.ts b/packages/tests/tests/filter/single_node/subscribe.node.spec.ts index fa53c19608..6f26d57478 100644 --- a/packages/tests/tests/filter/single_node/subscribe.node.spec.ts +++ b/packages/tests/tests/filter/single_node/subscribe.node.spec.ts @@ -222,81 +222,37 @@ describe("Waku Filter V2: Subscribe: Single Service Node", function () { }); }); - it("Subscribe to 100 topics (new limit) at once and receives messages", async function () { - let topicCount: number; - if (isNwakuAtLeast("0.25.0")) { - this.timeout(50000); - topicCount = 100; - } else { - // skipping for old versions where the limit is 30 - this.skip(); - } - const td = generateTestData(topicCount); - - await subscription.subscribe(td.decoders, messageCollector.callback); - - // Send a unique message on each topic. - for (let i = 0; i < topicCount; i++) { - await waku.lightPush.send(td.encoders[i], { - payload: utf8ToBytes(`Message for Topic ${i + 1}`) - }); - } - - // Open issue here: https://github.com/waku-org/js-waku/issues/1790 - // That's why we use the try catch block - try { - // Verify that each message was received on the corresponding topic. - expect(await messageCollector.waitForMessages(topicCount)).to.eq(true); - td.contentTopics.forEach((topic, index) => { - messageCollector.verifyReceivedMessage(index, { - expectedContentTopic: topic, - expectedMessageText: `Message for Topic ${index + 1}` - }); - }); - } catch (error) { - console.warn( - "This test still fails because of https://github.com/waku-org/js-waku/issues/1790" - ); - } - }); - - //TODO: remove test when WAKUNODE_IMAGE is 0.25.0 - it("Subscribe to 30 topics (old limit) at once and receives messages", async function () { - let topicCount: number; - if (isNwakuAtLeast("0.25.0")) { - // skipping for new versions where the new limit is 100 - this.skip(); - } else { - topicCount = 30; - } + it.only("Subscribe to 100 topics (limit) at once and receives messages", async function () { + this.timeout(50000); + const topicCount: number = 33; const td = generateTestData(topicCount); + console.log("subscribing"); await subscription.subscribe(td.decoders, messageCollector.callback); + console.log("subscribed"); // Send a unique message on each topic. for (let i = 0; i < topicCount; i++) { - await waku.lightPush.send(td.encoders[i], { - payload: utf8ToBytes(`Message for Topic ${i + 1}`) - }); + console.log("sending msg, ", i); + try { + await waku.lightPush.send(td.encoders[i], { + payload: utf8ToBytes(`Message for Topic ${i + 1}`) + }); + } catch (error) { + console.error("error on send ", i + 1, error); + } + if (i % 10 === 0) await delay(2000); } - // Open issue here: https://github.com/waku-org/js-waku/issues/1790 - // That's why we use the try catch block - try { - // Verify that each message was received on the corresponding topic. - expect(await messageCollector.waitForMessages(topicCount)).to.eq(true); - td.contentTopics.forEach((topic, index) => { - messageCollector.verifyReceivedMessage(index, { - expectedContentTopic: topic, - expectedMessageText: `Message for Topic ${index + 1}` - }); + // Verify that each message was received on the corresponding topic. + expect(await messageCollector.waitForMessages(topicCount)).to.eq(true); + td.contentTopics.forEach((topic, index) => { + messageCollector.verifyReceivedMessage(index, { + expectedContentTopic: topic, + expectedMessageText: `Message for Topic ${index + 1}` }); - } catch (error) { - console.warn( - "This test still fails because of https://github.com/waku-org/js-waku/issues/1790" - ); - } + }); }); it("Error when try to subscribe to more than 101 topics (new limit)", async function () {