Separate shutdown process to pinpoint CI failure

This commit is contained in:
Franck Royer 2021-08-09 12:27:52 +10:00
parent dcdab3203d
commit 355b8414d8
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 13 additions and 5 deletions

View File

@ -8,10 +8,21 @@ import { makeLogFileName, NimWaku, NOISE_KEY_1 } from '../test_utils/';
import { Waku } from './waku';
describe('Waku Dial', function () {
let waku: Waku;
let nimWaku: NimWaku;
afterEach(async function () {
this.timeout(10_000);
nimWaku ? nimWaku.stop() : null;
waku ? await waku.stop() : null;
});
describe('Interop: Nim', function () {
it('nim connects to js', async function () {
this.timeout(10_000);
const waku = await Waku.create({
waku = await Waku.create({
staticNoiseKey: NOISE_KEY_1,
libp2p: {
addresses: { listen: ['/ip4/0.0.0.0/tcp/0'] },
@ -21,7 +32,7 @@ describe('Waku Dial', function () {
const multiAddrWithId = waku.getLocalMultiaddrWithID();
const nimWaku = new NimWaku(makeLogFileName(this));
nimWaku = new NimWaku(makeLogFileName(this));
await nimWaku.start({ staticnode: multiAddrWithId });
const nimPeers = await nimWaku.peers();
@ -38,9 +49,6 @@ describe('Waku Dial', function () {
const jsPeers = waku.libp2p.peerStore.peers;
expect(jsPeers.has(nimPeerId.toB58String())).to.be.true;
nimWaku.stop();
await waku.stop();
});
});
});