Skip to content
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

test: Avoid logging error when logging error #31408

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Dec 3, 2024

Currently a logging error in the form of --- Logging error --- happens when an error is logged in the _on_data helper.

Fix it by properly logging the error.

Also, treat pylint errors as errors, to avoid this problem in the future.

Can be tested by running p2p_addrv2_relay.py with the following example diff:

diff --git a/test/functional/test_framework/p2p.py b/test/functional/test_framework/p2p.py
index 523e1bd068..0f1eb29d13 100755
--- a/test/functional/test_framework/p2p.py
+++ b/test/functional/test_framework/p2p.py
@@ -137,7 +137,7 @@ MESSAGEMAP = {
     b"notfound": msg_notfound,
     b"ping": msg_ping,
     b"pong": msg_pong,
-    b"sendaddrv2": msg_sendaddrv2,
+    #b"sendaddrv2": msg_sendaddrv2,
     b"sendcmpct": msg_sendcmpct,
     b"sendheaders": msg_sendheaders,
     b"sendtxrcncl": msg_sendtxrcncl,

@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 3, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31408.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK fanquake

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@DrahtBot DrahtBot added the Tests label Dec 3, 2024
Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK cccca8a

@fanquake fanquake merged commit 6d973f8 into bitcoin:master Dec 5, 2024
18 checks passed
@maflcko maflcko deleted the 2412-test-log-err branch December 5, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants