-
Notifications
You must be signed in to change notification settings - Fork 1.3k
stop() throws error: libp2p node is not started yet #1330
Comments
@coyotespike could you please share the snipped where you create the IPFS node? |
@diasdavid Sure thing!
|
What does the |
It is nothing fancy:
A lot of that is probably unnecessary. |
Currently there are problems with using globalSetup in jest when running tests in parallel which might lead to unexpected behaviour: jestjs/jest#5731 Try running the tests serially. |
Currently, to prevent race conditions within unit tests, or between unit tests and integration tests, I'm using |
Hey @coyotespike looking at the stack trace, it seems like https://github.com/ipfs-shipyard/ipfs-pubsub-room is unsubscribing an internal pubsub handler after the js-ipfs node has stopped. It registers a listener for the IPFS node stopping here: ...which, when triggered, calls ...which attempts to unsubscribe this handler on the stopped IPFS node: This looks like a separate issue to the issues you referenced and you should open an issue on the Heads up @pgte |
Thanks for the detective work @alanshaw! that makes sense, I'll file an issue with |
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:
ipfs.ready
is simply a promise that returns when IPFS emits theready
event.There's no difference in setup, but one test suite always produces the error
libp2p node is not started yet
. Runningipfs.stop()
is necessary in order to free up the resource for the next testing suite. It's also necessary to usejest --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.The text was updated successfully, but these errors were encountered: