You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
I've been going through the code and identifying patterns or ways to help clean up the code to make things easier to read and understand.
(Note: I've been working off of the in-progress PR #290)
There are a few tests that require multiple nodes to be connected (ping, pubsub, dht).
Running through this I found this setup code for ping, which uses a method waitUntilConnected, which doesn't actually connect any nodes, but instead just waits around till the nodes find each other (as far as I can tell).
It appears that it heavily relies on peer discovery, which is dependent on how the node is configured, particularity for js-ipfs-core.
@alanshaw I believe you wrote this code. I believe it was added so that the tests itself did not have to attempt to find and connect to the peers, and instead could rely on the peers already being connected before conducting the pings.
Any reasons to use waitUntilConnected over simply calling ipfs.swarm.connect?
The text was updated successfully, but these errors were encountered:
In hindsight I think this was a mistake and I'm going to send a PR to just connect the nodes that need to be connected, if the test is not explicitly testing discovery.
To phrase it another way, we don't want to have to skip tests that are testing features that aren't discovery related.
I've come to appreciate the state of discovery a whole lot more. In windows AFAIK there's no MDNS so waiting could take an indeterminate amount of time while the DHT bootstraps and our peers get registered on it and there's also this weirdness where in 0.4.14+ our spawned nodes never acquire any peers.
I've been going through the code and identifying patterns or ways to help clean up the code to make things easier to read and understand.
(Note: I've been working off of the in-progress PR #290)
There are a few tests that require multiple nodes to be connected (ping, pubsub, dht).
Running through this I found this setup code for
ping
, which uses a methodwaitUntilConnected
, which doesn't actually connect any nodes, but instead just waits around till the nodes find each other (as far as I can tell).https://github.com/ipfs/interface-ipfs-core/blob/f238e9f0ba8132dba51d3bac1eb491701f505ccd/js/src/ping.js#L38-L52
It appears that it heavily relies on peer discovery, which is dependent on how the node is configured, particularity for js-ipfs-core.
@alanshaw I believe you wrote this code. I believe it was added so that the tests itself did not have to attempt to find and connect to the peers, and instead could rely on the peers already being connected before conducting the pings.
Any reasons to use
waitUntilConnected
over simply callingipfs.swarm.connect
?The text was updated successfully, but these errors were encountered: