This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
stop() throws error: libp2p node is not started yet #1330
Closed
Description
- Version: version: '0.28.1', repo: 6, commit: ''
- Platform: Ubuntu
- Subsystem: libp2p
Type: Bug
Severity: Medium
Description: When running tests with Jest, one test produces this error before going on to complete successfully.
Steps to reproduce the error:
In each test suite, I have:
beforeAll(async () => {
await ipfs.ready();
});
afterAll(async () => {
await ipfs.stop();
});
ipfs.ready
is simply a promise that returns when IPFS emits the ready
event.
There's no difference in setup, but one test suite always produces the error libp2p node is not started yet
. Running ipfs.stop()
is necessary in order to free up the resource for the next testing suite. It's also necessary to use jest --runInBand
to run the test suites sequentially.
I have tried using globalSetup
to get around this but without success. Possibly related to #874 and #841. Full output below.
Error: The libp2p node is not started yet
at Object.unsubscribe (/<rootDir>/node_modules/libp2p/src/pubsub.js:38:15)
at Object.unsubscribe (/<rootDir>/node_modules/ipfs/src/core/components/pubsub.js:29:31)
at PubSubRoom.once (/<rootDir>/node_modules/ipfs-pubsub-room/src/index.js:121:25)
at Object.onceWrapper (events.js:254:19)
at PubSubRoom.emit (events.js:159:13)
at PubSubRoom.leave (/<rootDir>/node_modules/ipfs-pubsub-room/src/index.js:60:10)
at IPFS.emit (events.js:159:13)
at done (/<rootDir>/node_modules/ipfs/src/core/components/stop.js:26:12)
at /<rootDir>/node_modules/async/internal/parallel.js:39:9
at /<rootDir>/node_modules/async/internal/once.js:12:16
at replenish (/<rootDir>/node_modules/async/internal/eachOfLimit.js:59:25)
at iterateeCallback (/<rootDir>/node_modules/async/internal/eachOfLimit.js:49:17)
at /<rootDir>/node_modules/async/internal/onlyOnce.js:12:16
at /<rootDir>/node_modules/async/internal/parallel.js:36:13
at series (/<rootDir>/node_modules/ipfs-repo/src/index.js:195:17)
at /<rootDir>/node_modules/async/internal/parallel.js:39:9
at /<rootDir>/node_modules/async/internal/once.js:12:16
at replenish (/<rootDir>/node_modules/async/internal/eachOfLimit.js:59:25)
at iterateeCallback (/<rootDir>/node_modules/async/internal/eachOfLimit.js:49:17)
at /<rootDir>/node_modules/async/internal/onlyOnce.js:12:16
at /<rootDir>/node_modules/async/internal/parallel.js:36:13
at series (/<rootDir>/node_modules/ipfs-repo/src/index.js:193:9)
at /<rootDir>/node_modules/async/internal/parallel.js:31:39
at replenish (/<rootDir>/node_modules/async/internal/eachOfLimit.js:64:17)
at iterateeCallback (/<rootDir>/node_modules/async/internal/eachOfLimit.js:49:17)
at /<rootDir>/node_modules/async/internal/onlyOnce.js:12:16
at /<rootDir>/node_modules/async/internal/parallel.js:36:13
at /<rootDir>/node_modules/async/internal/parallel.js:39:9
at /<rootDir>/node_modules/async/internal/once.js:12:16
at replenish (/<rootDir>/node_modules/async/internal/eachOfLimit.js:59:25)
at iterateeCallback (/<rootDir>/node_modules/async/internal/eachOfLimit.js:49:17)
at /<rootDir>/node_modules/async/internal/onlyOnce.js:12:16
at /<rootDir>/node_modules/async/internal/parallel.js:36:13
at /<rootDir>/node_modules/graceful-fs/graceful-fs.js:43:10
at /<rootDir>/node_modules/graceful-fs/graceful-fs.js:43:10
at /<rootDir>/node_modules/graceful-fs/graceful-fs.js:43:10
at FSReqWrap.oncomplete (fs.js:149:20)
Metadata
Metadata
Assignees
Labels
No labels