-
Notifications
You must be signed in to change notification settings - Fork 37.9k
test: add end-to-end tests for CConnman and PeerManager #26812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/26812. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. LLM Linter (✨ experimental)Possible typos and grammar issues:
drahtbot_id_5_m |
|
|
|
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
|
|
2427939 test: forbid copying of DebugLogHelper (Daniel Pfeifer) d6aa266 test: don't throw from the destructor of DebugLogHelper (Vasil Dimov) Pull request description: Throwing an exception from the destructor of a class is a bad practice because the destructor will be called when an object of that type is alive on the stack and another exception is thrown, which will result in "exception during the exception". This would terminate the program without any messages. Instead print the message to the standard error output and call `std::abort()`. --- This change is part of #26812. It is an improvement on its own, so creating a separate PR for it following the discussion at #32604 (comment). Getting it in will reduce the size of #26812. ACKs for top commit: Crypt-iQ: crACK 2427939 l0rinc: Code review reACK 2427939 optout21: crACK 2427939 furszy: utACK 2427939 Tree-SHA512: 918c1e40d2db4ded6213cd78a18490ad10a9f43c0533df64bdf09f0b216715415030e444712981e4407c32ebf552fbb0e3cce718e048df10c2b8937caf015564
Extend `DebugLogHelper::~DebugLogHelper()` to be able to optionally wait for messages, possibly logged from another thread, to arrive before performing the final check.
…anager Add tests that use a mocked socket to similate network IO and cover the full `CConnman`, `PeerManager` and the interaction between them.
Part of this PR was merged via #33388, so drop that bit from here. Thanks! |
Add unit tests that write data to a mocked socket and inspect what CConnman/PeerManager have written back to the socket, or check the internal state to verify that the behavior is as expected.
This is now possible, after most of #21878 has been merged - we don't do any syscalls (e.g.
connect()
,recv()
) from the high level code and using a mocked socket allows testing the entire networking stack without opening actual network connections.