Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

[peer discovery] Add test suite and add it to all implementations #26

Closed
3 of 7 tasks
jacobheun opened this issue Apr 15, 2019 · 4 comments
Closed
3 of 7 tasks

Comments

@jacobheun
Copy link
Contributor

jacobheun commented Apr 15, 2019

Currently this repo has no test suite, it needs one. Once that's in place, all current implementations need to have the test suite added to them.

Tests

Implementations

Add the test suite to:

@jacobheun
Copy link
Contributor Author

Adding thoughts on tests here for when this is implemented. Feel free to comment with additional thoughts.

Tests

  • should be able to find another peer

Modules will be responsible for creating the setup needed for discovery. .start() will be called on the module and it is expected that the peer will be discovered before the test times out. Implementing modules should take care to make the discovery happen quickly, to avoid lengthy tests. For example, an interval based discovery, like libp2p-bootstrap should trigger shortly after startup.

  • should not emit events when stopped

Modules should emit peers infinitely. .start() will be called followed by .stop() with a small delay (100 ms?). Modules will be expected to have emitted discovery events after start and before stop. After stop, any emitted events will fail the test.

  • ...

@jacobheun
Copy link
Contributor Author

It might also be valuable to do a test to verify we are not emitting ourselves as a discovered peer.

@dirkmc
Copy link
Contributor

dirkmc commented Jun 3, 2019

Maybe also a test to ensure discovery continues after start, stop, start

@daviddias daviddias transferred this issue from libp2p/interface-peer-discovery Feb 5, 2020
@daviddias daviddias changed the title Add test suite and add it to all implementations [peer discovery] Add test suite and add it to all implementations Feb 5, 2020
@vasco-santos
Copy link
Member

We already added these to each discovery implementation, except for the DHT. The DHT already has an issue to track it support once we refactor it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants