test: Add BitcoinTestFramework::sync_* methods #15773

pull MarcoFalke wants to merge 6 commits into bitcoin:master from MarcoFalke:1904-qaSyncNew changing 32 files +331 −288
  1. MarcoFalke commented at 11:23 pm on April 8, 2019: member

    This adds methods to the test framework that can be called by just self.sync_*().

    This avoids having to import the underlying util method. Also, in the default case, where all nodes are synced this avoid having to pass self.nodes explicitly.

    So the effective changes are:

    0@@
    1-from test_framework.util import sync_blocks, sync_mempools
    2@@
    3-        sync_blocks(self.nodes)
    4+        self.sync_blocks()
    5@@
    6-        sync_mempools(self.nodes)
    7+        self.sync_mempools()
    
  2. fanquake added the label Tests on Apr 8, 2019
  3. scripted-diff: Rename sync_blocks to send_blocks to avoid name collisions and confusion
    -BEGIN VERIFY SCRIPT-
    FILE_LIST=$(git grep -l 'def sync_blocks' ./test/functional/*.py)
    sed -i -e 's/def sync_blocks/def send_blocks/g'   $FILE_LIST
    sed -i -e 's/self.sync_blocks/self.send_blocks/g' $FILE_LIST
    -END VERIFY SCRIPT-
    fa4680ed09
  4. MarcoFalke force-pushed on Apr 8, 2019
  5. DrahtBot commented at 1:54 am on April 9, 2019: member

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #12911 (wallet: Show fee in results for signrawtransaction* for segwit inputs by kallewoof)

    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.

  6. promag commented at 7:35 am on April 9, 2019: member

    Concept ACK.

    Could move sync_block implementation to TestFramework?

  7. MarcoFalke commented at 1:08 pm on April 9, 2019: member

    Could move sync_block implementation to TestFramework?

    Good point, but to keep the diff complete but still minimal, I’d like to do this in a later pull request. (I have some changes that build on top of this)

  8. in test/functional/example_test.py:120 in fade397d70 outdated
    116@@ -117,7 +117,7 @@ def setup_network(self):
    117         # sync_all() should not include node2, since we're not expecting it to
    118         # sync.
    119         connect_nodes(self.nodes[0], 1)
    120-        self.sync_all([self.nodes[0:2]])
    121+        self.sync_all(self.nodes[0:2])
    


    promag commented at 1:17 pm on April 9, 2019:

    commit fade397d70cd23d504d335bf8c21cb3ed6c2cbd4

    I’d commit these [] drops separately.

  9. in test/functional/wallet_bumpfee.py:63 in fae14a07b6 outdated
    59@@ -60,7 +60,7 @@ def run_test(self):
    60 
    61         self.log.info("Running tests")
    62         dest_address = peer_node.getnewaddress()
    63-        test_simple_bumpfee_succeeds(rbf_node, peer_node, dest_address)
    


    promag commented at 1:18 pm on April 9, 2019:

    commit fae14a07b6a31211ea3bd0c707754b4b743d03d2

    Could mention in the commit message that this is required for the upcoming scripted diff.

  10. promag commented at 1:19 pm on April 9, 2019: member
    utACK fa262df3635e02894f6837e5425d25ce522118cd.
  11. jnewbery commented at 3:20 pm on April 9, 2019: member
    Concept ACK
  12. MarcoFalke force-pushed on Apr 9, 2019
  13. MarcoFalke commented at 3:48 pm on April 9, 2019: member
    Reworked commits as suggested by @promag. No code changes.
  14. MarcoFalke commented at 3:50 pm on April 9, 2019: member

    Tests can be run on all commits via

    0git rebase --interactive --exec "./test/functional/test_runner.py -j 9" HEAD~6
    
  15. test: Pass at most one node group to sync_all fafe008cb4
  16. test: Add BitcoinTestFramework::sync_* methods fa6dc7c5c3
  17. test: Pass self to test_simple_bumpfee_succeeds
    Needed for a future scripted diff
    faf77f9b90
  18. scripted-diff: use self.sync_* methods
    -BEGIN VERIFY SCRIPT-
    sed -i -e 's/sync_blocks(self.nodes)/self.sync_blocks()/g'     $(git grep -l 'sync_blocks(self.nodes)'   ./test/functional/*.py)
    sed -i -e 's/sync_mempools(self.nodes)/self.sync_mempools()/g' $(git grep -l 'sync_mempools(self.nodes)' ./test/functional/*.py)
    
    sed -i -e 's/  sync_blocks(/  self.sync_blocks(/g'     $(git grep -l sync_blocks   ./test/functional/*.py)
    sed -i -e 's/  sync_mempools(/  self.sync_mempools(/g' $(git grep -l sync_mempools ./test/functional/*.py)
    -END VERIFY SCRIPT-
    fa16a09215
  19. test: Remove unused imports fafe5f0d09
  20. MarcoFalke force-pushed on Apr 9, 2019
  21. promag commented at 11:17 pm on April 9, 2019: member
    utACK fafe5f0.
  22. in test/functional/p2p_node_network_limited.py:16 in fafe5f0d09
    10@@ -11,7 +11,13 @@
    11 from test_framework.messages import CInv, msg_getdata, msg_verack, NODE_BLOOM, NODE_NETWORK_LIMITED, NODE_WITNESS
    12 from test_framework.mininode import P2PInterface, mininode_lock
    13 from test_framework.test_framework import BitcoinTestFramework
    14-from test_framework.util import assert_equal, disconnect_nodes, connect_nodes_bi, sync_blocks, wait_until
    15+from test_framework.util import (
    16+    assert_equal,
    17+    disconnect_nodes,
    


    jonatack commented at 2:51 pm on April 11, 2019:
    Nit: connect_nodes_bi before disconnect_nodes.
  23. in test/functional/wallet_import_rescan.py:24 in fafe5f0d09
    19@@ -20,7 +20,12 @@
    20 """
    21 
    22 from test_framework.test_framework import BitcoinTestFramework
    23-from test_framework.util import (assert_raises_rpc_error, connect_nodes, sync_blocks, assert_equal, set_node_times)
    24+from test_framework.util import (
    25+    assert_raises_rpc_error,
    


    jonatack commented at 2:53 pm on April 11, 2019:
    Nit: ordering of first 3 methods in this import.
  24. jonatack commented at 3:05 pm on April 11, 2019: member
  25. MarcoFalke merged this on Apr 11, 2019
  26. MarcoFalke closed this on Apr 11, 2019

  27. MarcoFalke referenced this in commit 0e9cb2d24d on Apr 11, 2019
  28. MarcoFalke deleted the branch on Apr 11, 2019
  29. UdjinM6 referenced this in commit 54198ce739 on Apr 14, 2020
  30. deadalnix referenced this in commit abfb35f181 on May 20, 2020
  31. deadalnix referenced this in commit d085bd1905 on May 20, 2020
  32. deadalnix referenced this in commit 58917414fd on May 20, 2020
  33. deadalnix referenced this in commit 670e5e820e on May 20, 2020
  34. ckti referenced this in commit 56853f84b7 on Mar 28, 2021
  35. vijaydasmp referenced this in commit 717c7a425b on Nov 7, 2021
  36. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-16 21:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me