Skip to content

Commit

Permalink
try some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
weboko committed Jan 15, 2024
1 parent b301ba3 commit a3c26a6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
12 changes: 8 additions & 4 deletions packages/tests/tests/filter/multiple_pubsub.node.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,14 @@ describe("Waku Filter V2 (Named sharding): Multiple PubsubTopics", function () {

this.beforeEach(async function () {
this.timeout(15000);
[nwaku, waku] = await runNodes(this, [
customPubsubTopic1,
customPubsubTopic2
]);
[nwaku, waku] = await runNodes(
this,
[customPubsubTopic1, customPubsubTopic2],
{
clusterId: 3,
shards: [1, 2]
}
);
subscription = await waku.filter.createSubscription(customPubsubTopic1);
messageCollector = new MessageCollector();
});
Expand Down
1 change: 1 addition & 0 deletions packages/tests/tests/peer_exchange.node.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { makeLogFileName } from "../src/log_file.js";
import { NimGoNode } from "../src/node/node.js";

describe("Peer Exchange", () => {
// TODO: fails for a long time
describe("Locally Run Nodes", () => {
let waku: LightNode;
let nwaku1: NimGoNode;
Expand Down
18 changes: 11 additions & 7 deletions packages/tests/tests/store/multiple_pubsub.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ describe("Waku Store (Autosharding), custom pubsub topic", function () {
});
});

describe("Waku Store (named sharding), custom pubsub topic", function () {
describe.only("Waku Store (named sharding), custom pubsub topic", function () {
this.timeout(15000);
let waku: LightNode;
let nwaku: NimGoNode;
Expand All @@ -342,18 +342,22 @@ describe("Waku Store (named sharding), custom pubsub topic", function () {
nwaku = new NimGoNode(makeLogFileName(this));
await nwaku.start({
store: true,
pubsubTopic: [customShardedPubsubTopic1, customShardedPubsubTopic2],
relay: true
relay: true,
pubsubTopic: [customShardedPubsubTopic1, customShardedPubsubTopic2]
});
await nwaku.ensureSubscriptions([
customShardedPubsubTopic1,
customShardedPubsubTopic2
]);

waku = await startAndConnectLightNode(nwaku, [
customShardedPubsubTopic1,
customShardedPubsubTopic2
]);
waku = await startAndConnectLightNode(
nwaku,
[customShardedPubsubTopic1, customShardedPubsubTopic2],
{
clusterId: 3,
shards: [1, 2]
}
);
});

afterEach(async function () {
Expand Down
7 changes: 4 additions & 3 deletions packages/tests/tests/store/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ export async function startAndConnectLightNode(
shardInfo?: ShardingParams
): Promise<LightNode> {
const waku = await createLightNode({
pubsubTopics: shardInfo ? undefined : pubsubTopics,
staticNoiseKey: NOISE_KEY_1,
libp2p: { addresses: { listen: ["/ip4/0.0.0.0/tcp/0/ws"] } },
...((pubsubTopics.length !== 1 ||
pubsubTopics[0] !== DefaultPubsubTopic) && {
shardInfo: shardInfo
}),
pubsubTopics: shardInfo ? undefined : pubsubTopics,
staticNoiseKey: NOISE_KEY_1
})
});
await waku.start();
await waku.dial(await instance.getMultiaddrWithId());
Expand Down

0 comments on commit a3c26a6

Please sign in to comment.