-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tests): For DNS discovery only use a local DNS server (#2598)
## Description Because the Node builder by default configures DNS discovery the tests all do a lookup. This went to the staging DNS server, but even so, we hit 429 Too Many Requests on this sometimes. Instead this configures a domain under `.test.`. This domain is reserved for tests and any DNS server should return an emtpy response without going through upstream DNS servers - unless the records were directly added to the DNS server receiving the query in which case it will respond. So now all our default DNS discovery just doesn't discover anything, which is fine as all tests have other mechanisms to find the nodes. The tests that do use DNS discovery run their own local DNS server for this, which is also switched to `.test.`, because that's the right domain to use for this. ## Breaking Changes When using `iroh::node::Node` in tests, when `cfg(test)` is enabled, the default node discovery will no longer work. You must explicitly configure the node discovery, options to use a test-local node discovery or a staging node discovery are described in the API docs. ## Notes & open questions I feel like we should also try this with the relay server. That will probably be a bit harder and it is not an issue for me right now. I actually need this for the quinn11 branch, but the fix is so generic that it makes more sense to do on main and merge it back. ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented.
- Loading branch information
Showing
5 changed files
with
94 additions
and
19 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