-
Notifications
You must be signed in to change notification settings - Fork 37.7k
tests: Skip P2PConnection's is_closing() check when not available #13747
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
Merged
Conversation
This file contains hidden or 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
utACK 4728553290aebd9fc22f08c8bc73b05a45fb388a |
utACK 4728553290aebd9fc22f08c8bc73b05a45fb388a |
maybe add a note that this is to support python < 3.4.4, so that it's easier to find and remove this workaround when support for these versions is dropped |
bitcoin#13715 introduced a new check for _transport.is_closing() in mininode's P2PConnection's. This function is only available from Python 3.4.4, though, while Bitcoin is supposed to support all Python 3.4 versions. In this change, we make the check conditional on is_closing() being available. If it is not, then we revert to the behaviour before the check was introduced; this means that bitcoin#13579 is not fixed for old systems, but at least the tests work as they used to do before. This includes a small refactoring from a one-line lambda to an inline function, because this makes the code easier to read with more and more conditions being added. Fixes bitcoin#13745.
4728553
to
64b9f27
Compare
Added a comment as suggested by @flack. |
maflcko
pushed a commit
that referenced
this pull request
Jul 23, 2018
… available 64b9f27 Skip is_closing() check when not available. (Daniel Kraft) Pull request description: #13715 introduced a new check for `_transport.is_closing()` in mininode's `P2PConnection`'s. This function is [only available from Python 3.4.4](https://docs.python.org/3.4/library/asyncio-protocol.html#asyncio.BaseTransport.is_closing), though, while Bitcoin Core is supposed to support all Python 3.4 versions. In this change, we make the check conditional on `is_closing` being available. If it is not, then we revert to the behaviour before the check was introduced; this means that #13579 is not fixed for old systems, but at least the tests work as they used to do before. This includes a small refactoring from a one-line lambda to an inline function, because this makes the code easier to read with more and more conditions being added. Fixes #13745. Tree-SHA512: 15be03b8b49c40a946c5b354c5974858d14dc46283ad48ee25d9e269377077ce741c6b379b3f6581ab981cb65be799809afbb99da278caaa2d8d870fa4fb748f
domob1812
added a commit
to domob1812/namecoin-core
that referenced
this pull request
Jul 30, 2018
Replaced the hacky workaround for the upstream mininode.py issue with Python <3.4.4 from b233b9c with the upstream fix bitcoin/bitcoin#13747. Conflicts: test/functional/test_framework/mininode.py
random-zebra
added a commit
to PIVX-Project/PIVX
that referenced
this pull request
Jun 28, 2021
…t framework update) 7b04c0a [Test] Clean duplicate connections creation in mining_pos_coldStaking.py (furszy) 15a799e [Test] MAX_PROTOCOL_MESSAGE_LENGTH PIVXified. (furszy) 0aedf35 [tests] Don't import asyncio to test magic bytes (John Newbery) 9bb5309 Refactor resource exhaustion test (Troy Giorshev) 589a780 Fix "invalid message size" test (Troy Giorshev) 8a0c12b Move size limits to module-global (Troy Giorshev) b3391c5 Remove two unneeded tests (Troy Giorshev) 1404e68 test: Add various low-level p2p tests (furszy) 8aaf7e1 test: Remove fragile assert_memory_usage_stable (MarcoFalke) f68e22c [Test] p2p_invalid_messages.py do not change msg.command in test_command and raise sync_with_ping timeout (furszy) c851c0b Test framework: Wait for verack by default on every new connection (furszy) c02e9a0 [Test] move framework subversion to string (furszy) 3472a39 Replace coroutine with async def in p2p_invalid_messages.py (Elichai Turkel) 33c7b19 net_processing: align msg checksum check properly. (furszy) 7f71b1b Hash P2P messages as they are received instead of at process-time (furszy) 215a638 test: Skip flaky p2p_invalid_messages test on macOS (Fabian Jahr) c11f565 qa: Make swap_magic_bytes in p2p_invalid_messages atomic (MarcoFalke) be979ad test: Fix race in p2p_invalid_messages (MarcoFalke) 6a72f0c qa: Add tests for invalid message headers (MarcoFalke) 51ddd3d Introduce p2p_invalid_messages.py test (furszy) 55a37b5 net: fix missing jump line in "Oversized message from peer.." error. (furszy) 0edfce5 test_node: get_mem_rss fixups (MarcoFalke) 6f21213 tests: add P2PConnection.send_raw_message (James O'Beirne) ae68c6e tests: add utility to assert node memory usage hasn't increased (James O'Beirne) 8469afe test: forward timeouts properly in send_blocks_and_test (James O'Beirne) db28a53 Skip is_closing() check when not available. (Daniel Kraft) be9dacb tests: fixes mininode's P2PConnection sending messages on closing transport (marcoagner) 53599c8 qa: Avoid start/stop of the network thread mid-test (furszy) 688190c [qa] mininode: Expose connection state through is_connected (MarcoFalke) Pull request description: Part of the deep and long net and ser work that I'm doing (and Tor v3 onion addresses support). Friend of #2359. Focused on the end goal of implementing the `p2p_invalid_messages` functional test which validates that invalid msg headers, msg types, oversized payloads and inventory msgs aren't accepted nor can cause a resource exhaustion. And an extra covered scenario, in `p2p_invalid_tx.py`, for the orphan pool overflow. Plus, to get up to the goal, had to work over the functional test framework as well. So.. adapted list: * bitcoin#9045. * bitcoin#13512. * bitcoin#13517. * bitcoin#13715. * bitcoin#13747. * bitcoin#14456. * bitcoin#14522. * bitcoin#14672. * bitcoin#14693. * bitcoin#14812. * bitcoin#15246. * bitcoin#15330. * bitcoin#15697. * bitcoin#16445. * bitcoin#17931. * bitcoin#17469. * bitcoin#18628 (only `p2p_invalid_tx.py` and `p2p_invalid_messages.py`. We don't support the other tests yet). * bitcoin#19177. * bitcoin#19264. ACKs for top commit: random-zebra: utACK 7b04c0a and merging... Tree-SHA512: 48d1f1a6acc24a9abce033fbf1f281ba4392147da39d118a694a09d63c3e0610cc1a29d711b434b16cc0d0e030dd9f1a89843870091b6999b862b9ab18a20679
UdjinM6
pushed a commit
to UdjinM6/dash
that referenced
this pull request
Jun 29, 2021
…hen not available 64b9f27 Skip is_closing() check when not available. (Daniel Kraft) Pull request description: bitcoin#13715 introduced a new check for `_transport.is_closing()` in mininode's `P2PConnection`'s. This function is [only available from Python 3.4.4](https://docs.python.org/3.4/library/asyncio-protocol.html#asyncio.BaseTransport.is_closing), though, while Bitcoin Core is supposed to support all Python 3.4 versions. In this change, we make the check conditional on `is_closing` being available. If it is not, then we revert to the behaviour before the check was introduced; this means that bitcoin#13579 is not fixed for old systems, but at least the tests work as they used to do before. This includes a small refactoring from a one-line lambda to an inline function, because this makes the code easier to read with more and more conditions being added. Fixes bitcoin#13745. Tree-SHA512: 15be03b8b49c40a946c5b354c5974858d14dc46283ad48ee25d9e269377077ce741c6b379b3f6581ab981cb65be799809afbb99da278caaa2d8d870fa4fb748f
UdjinM6
pushed a commit
to UdjinM6/dash
that referenced
this pull request
Jun 29, 2021
…hen not available 64b9f27 Skip is_closing() check when not available. (Daniel Kraft) Pull request description: bitcoin#13715 introduced a new check for `_transport.is_closing()` in mininode's `P2PConnection`'s. This function is [only available from Python 3.4.4](https://docs.python.org/3.4/library/asyncio-protocol.html#asyncio.BaseTransport.is_closing), though, while Bitcoin Core is supposed to support all Python 3.4 versions. In this change, we make the check conditional on `is_closing` being available. If it is not, then we revert to the behaviour before the check was introduced; this means that bitcoin#13579 is not fixed for old systems, but at least the tests work as they used to do before. This includes a small refactoring from a one-line lambda to an inline function, because this makes the code easier to read with more and more conditions being added. Fixes bitcoin#13745. Tree-SHA512: 15be03b8b49c40a946c5b354c5974858d14dc46283ad48ee25d9e269377077ce741c6b379b3f6581ab981cb65be799809afbb99da278caaa2d8d870fa4fb748f
UdjinM6
pushed a commit
to UdjinM6/dash
that referenced
this pull request
Jul 1, 2021
…hen not available 64b9f27 Skip is_closing() check when not available. (Daniel Kraft) Pull request description: bitcoin#13715 introduced a new check for `_transport.is_closing()` in mininode's `P2PConnection`'s. This function is [only available from Python 3.4.4](https://docs.python.org/3.4/library/asyncio-protocol.html#asyncio.BaseTransport.is_closing), though, while Bitcoin Core is supposed to support all Python 3.4 versions. In this change, we make the check conditional on `is_closing` being available. If it is not, then we revert to the behaviour before the check was introduced; this means that bitcoin#13579 is not fixed for old systems, but at least the tests work as they used to do before. This includes a small refactoring from a one-line lambda to an inline function, because this makes the code easier to read with more and more conditions being added. Fixes bitcoin#13745. Tree-SHA512: 15be03b8b49c40a946c5b354c5974858d14dc46283ad48ee25d9e269377077ce741c6b379b3f6581ab981cb65be799809afbb99da278caaa2d8d870fa4fb748f
UdjinM6
pushed a commit
to UdjinM6/dash
that referenced
this pull request
Jul 2, 2021
…hen not available 64b9f27 Skip is_closing() check when not available. (Daniel Kraft) Pull request description: bitcoin#13715 introduced a new check for `_transport.is_closing()` in mininode's `P2PConnection`'s. This function is [only available from Python 3.4.4](https://docs.python.org/3.4/library/asyncio-protocol.html#asyncio.BaseTransport.is_closing), though, while Bitcoin Core is supposed to support all Python 3.4 versions. In this change, we make the check conditional on `is_closing` being available. If it is not, then we revert to the behaviour before the check was introduced; this means that bitcoin#13579 is not fixed for old systems, but at least the tests work as they used to do before. This includes a small refactoring from a one-line lambda to an inline function, because this makes the code easier to read with more and more conditions being added. Fixes bitcoin#13745. Tree-SHA512: 15be03b8b49c40a946c5b354c5974858d14dc46283ad48ee25d9e269377077ce741c6b379b3f6581ab981cb65be799809afbb99da278caaa2d8d870fa4fb748f
UdjinM6
pushed a commit
to UdjinM6/dash
that referenced
this pull request
Jul 2, 2021
…hen not available 64b9f27 Skip is_closing() check when not available. (Daniel Kraft) Pull request description: bitcoin#13715 introduced a new check for `_transport.is_closing()` in mininode's `P2PConnection`'s. This function is [only available from Python 3.4.4](https://docs.python.org/3.4/library/asyncio-protocol.html#asyncio.BaseTransport.is_closing), though, while Bitcoin Core is supposed to support all Python 3.4 versions. In this change, we make the check conditional on `is_closing` being available. If it is not, then we revert to the behaviour before the check was introduced; this means that bitcoin#13579 is not fixed for old systems, but at least the tests work as they used to do before. This includes a small refactoring from a one-line lambda to an inline function, because this makes the code easier to read with more and more conditions being added. Fixes bitcoin#13745. Tree-SHA512: 15be03b8b49c40a946c5b354c5974858d14dc46283ad48ee25d9e269377077ce741c6b379b3f6581ab981cb65be799809afbb99da278caaa2d8d870fa4fb748f
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#13715 introduced a new check for
_transport.is_closing()
in mininode'sP2PConnection
's. This function is only available from Python 3.4.4, though, while Bitcoin Core is supposed to support all Python 3.4 versions.In this change, we make the check conditional on
is_closing
being available. If it is not, then we revert to the behaviour before the check was introduced; this means that #13579 is not fixed for old systems, but at least the tests work as they used to do before.This includes a small refactoring from a one-line lambda to an inline function, because this makes the code easier to read with more and more conditions being added.
Fixes #13745.