Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: unskip shard 0 test fixed by 1874 #1978

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions packages/tests/tests/sharding/static_sharding.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,43 @@ describe("Static Sharding: Running Nodes", function () {
});

describe("Different clusters and shards", function () {
// Will be skipped until https://github.com/waku-org/js-waku/issues/1874 is fixed
it.skip("shard 0", async function () {
it("shard 0", async function () {
const singleShardInfo = { clusterId: 0, shard: 0 };
const shardInfo = singleShardInfosToShardInfo([singleShardInfo]);

await nwaku.start({
store: true,
lightpush: true,
relay: true,
pubsubTopic: shardInfoToPubsubTopics(shardInfo)
});

await nwaku.ensureSubscriptions(shardInfoToPubsubTopics(shardInfo));

waku = await createLightNode({
shardInfo: shardInfo
});
await waku.dial(await nwaku.getMultiaddrWithId());
await waitForRemotePeer(waku, [Protocols.LightPush]);

const encoder = createEncoder({
contentTopic: ContentTopic,
pubsubTopicShardInfo: singleShardInfo
});
expect(encoder.pubsubTopic).to.eq(
singleShardInfoToPubsubTopic(singleShardInfo)
);

const request = await waku.lightPush.send(encoder, {
payload: utf8ToBytes("Hello World")
});

expect(request.successes.length).to.eq(1);
expect(
await messageCollector.waitForMessages(1, {
pubsubTopic: shardInfoToPubsubTopics(shardInfo)[0]
})
).to.eq(true);
});

// dedicated test for Default Cluster ID 0
Expand Down
Loading