mirror of https://github.com/waku-org/js-waku.git
Merge pull request #1592 from waku-org/fix/flaky-teardown
fix: increase timeout and use tearDownNodes
This commit is contained in:
commit
fe64da1881
|
@ -17,7 +17,12 @@ import chai, { expect } from "chai";
|
||||||
import chaiAsPromised from "chai-as-promised";
|
import chaiAsPromised from "chai-as-promised";
|
||||||
import sinon from "sinon";
|
import sinon from "sinon";
|
||||||
|
|
||||||
import { delay, makeLogFileName, NOISE_KEY_1 } from "../src/index.js";
|
import {
|
||||||
|
delay,
|
||||||
|
makeLogFileName,
|
||||||
|
NOISE_KEY_1,
|
||||||
|
tearDownNodes
|
||||||
|
} from "../src/index.js";
|
||||||
import { NimGoNode } from "../src/node/node.js";
|
import { NimGoNode } from "../src/node/node.js";
|
||||||
|
|
||||||
chai.use(chaiAsPromised);
|
chai.use(chaiAsPromised);
|
||||||
|
@ -43,13 +48,9 @@ describe("Util: toAsyncIterator: Filter", () => {
|
||||||
await waitForRemotePeer(waku, [Protocols.Filter, Protocols.LightPush]);
|
await waitForRemotePeer(waku, [Protocols.Filter, Protocols.LightPush]);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(async () => {
|
afterEach(async function () {
|
||||||
try {
|
this.timeout(10000);
|
||||||
await nwaku.stop();
|
await tearDownNodes(nwaku, waku);
|
||||||
await waku.stop();
|
|
||||||
} catch (err) {
|
|
||||||
console.log("Failed to stop", err);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("creates an iterator", async function () {
|
it("creates an iterator", async function () {
|
||||||
|
@ -99,6 +100,8 @@ describe("Util: toAsyncIterator: Filter", () => {
|
||||||
payload: utf8ToBytes("This should be received")
|
payload: utf8ToBytes("This should be received")
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await delay(400);
|
||||||
|
|
||||||
await stop();
|
await stop();
|
||||||
|
|
||||||
await waku.lightPush.send(TestEncoder, {
|
await waku.lightPush.send(TestEncoder, {
|
||||||
|
|
|
@ -22,10 +22,11 @@ import { expect } from "chai";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
makeLogFileName,
|
makeLogFileName,
|
||||||
NimGoNode,
|
|
||||||
NOISE_KEY_1,
|
NOISE_KEY_1,
|
||||||
NOISE_KEY_2
|
NOISE_KEY_2,
|
||||||
|
tearDownNodes
|
||||||
} from "../src/index.js";
|
} from "../src/index.js";
|
||||||
|
import { NimGoNode } from "../src/node/node.js";
|
||||||
|
|
||||||
const TestContentTopic = "/test/1/waku/utf8";
|
const TestContentTopic = "/test/1/waku/utf8";
|
||||||
|
|
||||||
|
@ -33,13 +34,12 @@ const TestEncoder = createPlainEncoder({ contentTopic: TestContentTopic });
|
||||||
|
|
||||||
describe("Waku Dial [node only]", function () {
|
describe("Waku Dial [node only]", function () {
|
||||||
describe("Interop: NimGoNode", function () {
|
describe("Interop: NimGoNode", function () {
|
||||||
let waku: Waku;
|
let waku: LightNode;
|
||||||
let nwaku: NimGoNode;
|
let nwaku: NimGoNode;
|
||||||
|
|
||||||
afterEach(async function () {
|
afterEach(async function () {
|
||||||
!!nwaku &&
|
this.timeout(15000);
|
||||||
nwaku.stop().catch((e) => console.log("Nwaku failed to stop", e));
|
await tearDownNodes(nwaku, waku);
|
||||||
!!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("connects to nwaku", async function () {
|
it("connects to nwaku", async function () {
|
||||||
|
@ -102,8 +102,8 @@ describe("Waku Dial [node only]", function () {
|
||||||
let nwaku: NimGoNode;
|
let nwaku: NimGoNode;
|
||||||
|
|
||||||
afterEach(async function () {
|
afterEach(async function () {
|
||||||
!!nwaku && (await nwaku.stop());
|
this.timeout(15000);
|
||||||
!!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e));
|
await tearDownNodes(nwaku, waku);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Passing an array", async function () {
|
it("Passing an array", async function () {
|
||||||
|
|
Loading…
Reference in New Issue