-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: always connect peers more realistically (#856)
Our tests currently connect `MapeoManager`s in two ways: 1. By starting peer discovery servers and connecting. This is similar to what the real app does. 2. By manually creating streams and connecting them in tests. This is less realistic. This commit removes the second way because: - it is less realistic - it lets us remove some test-only code in the `src/` directory - it will make an upcoming change easier - it used to be significantly faster, but that's no longer true I also tried to fix a possible (test-only) race condition, which *could* have been a reason for the less realistic option: 1. Start connecting peers by calling `connectPeers()`. This begins the process of starting peer discovery servers. 2. Disconnect them by calling the callback returned by `connectPeers()`. 3. The peer discovery servers start, and begin connecting. *This is bad* because we already wanted to disconnect!
- Loading branch information
Showing
7 changed files
with
43 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters