Actually run assumevalid.py #10073

pull jnewbery wants to merge 1 commits into bitcoin:master from jnewbery:improveassumevalid changing 2 files +59 −44
  1. jnewbery commented at 10:25 PM on March 24, 2017: member

    assumevalid.py was merged as part of PR 9484, but was not added to the test_runner, so is not run even as part of the extended tests.

    This commit adds assumevalid to the list of tests in test_runner. It also makes the code in assumevalid considerably clearer.

  2. Actually run assumevalid.py.
    assumevalid was merged as part of PR 9484, but was not added to the
    test_runner, so is not run even as part of the extended tests.
    
    This commit adds assumevalid to the list of tests in test_runner. It
    also clarifies the code in assumevalid considerably.
    717ad131f6
  3. gmaxwell commented at 5:51 AM on March 25, 2017: contributor

    utACK. We need to get in the habit of testing the tests by breaking the code, -- I do this sometimes, but clearly not enough.

  4. fanquake added the label Tests on Mar 25, 2017
  5. MarcoFalke commented at 2:14 PM on March 25, 2017: member

    Concept ACK. I was wondering if it makes sense to put the rpc tests in a separate folder and then run a check in test_runner, that all files in the folder are mentioned at least once in the test_runner file.

  6. jnewbery commented at 4:46 PM on March 25, 2017: member

    @MarcoFalke - I've already got a branch that does almost that (in my version I added an extra list NON_TESTS to test_runner and then check that all files in the functional directory appear in one of the test lists or NON_TESTS.

    I think your version is tidier. I'm happy to rework my branch or review a PR if you want to implement it. Whichever you prefer.

  7. NicolasDorier commented at 9:01 AM on March 26, 2017: contributor

    utACK 717ad131f6b665b2e7cf55db689da9616e727d78

  8. laanwj commented at 7:48 AM on March 27, 2017: member

    I was wondering if it makes sense to put the rpc tests in a separate folder

    Not sure about this. I agree that a way to identify 'orphan' tests would be great, however having scripts in multiple folders is unfortunately kind of annoying with Python and its automatic directory hierarchy for packages. Also it means having to think/search where the test is when manually running it. I think I prefer one directory with all the executable scripts.

  9. laanwj merged this on Mar 27, 2017
  10. laanwj closed this on Mar 27, 2017

  11. laanwj referenced this in commit b1a4f27576 on Mar 27, 2017
  12. laanwj commented at 2:15 PM on March 27, 2017: member

    The test is failing intermittently on master, it seems:

    2017-03-27 14:09:57.475000 TestFramework (ERROR): Assertion failed
    Traceback (most recent call last):
      File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 150, in main
        self.run_test()
      File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/test/functional/assumevalid.py", line 197, in run_test
        assert_equal(self.nodes[1].getblock(self.nodes[1].getbestblockhash())['height'], 2202)
      File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/test/functional/test_framework/util.py", line 476, in assert_equal
        raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
    AssertionError: not(1051 == 2202)
    
  13. in test/functional/assumevalid.py:197 in 717ad131f6
     200 | +        # Send all blocks to node1. All blocks will be accepted.
     201 |          for i in range(2202):
     202 |              node1.send_message(msg_block(self.blocks[i]))
     203 | -        node1.sync_with_ping() # make sure the most recent block is synced
     204 | +        node1.sync_with_ping()  # make sure the most recent block is synced
     205 |          assert_equal(self.nodes[1].getblock(self.nodes[1].getbestblockhash())['height'], 2202)
    


    NicolasDorier commented at 4:54 AM on March 28, 2017:

    using assert_blockchain_height should prevent it to fails intermittently. @jnewbery thoughts ?


    jnewbery commented at 8:08 PM on March 28, 2017:

    @NicolasDorier you may be right. I think that sync_with_ping() should be enough to make sure the node is sync'ed to the tip (p2p messages are processed sequentially and single threaded by bitcoind, so it shouldn't send a pong back until it's worked through all the block messages).

    Sadly there aren't quite enough logs to see what's going on here. I'm going to leave this as it is for a few more nightly runs to see if we can get a better set of diags. This is in the extended test suite so it won't cause PR or merge travis builds to fail.

    If I can't get to the bottom of why this is failing, I'll try with your change, but I'd like to understand what the problem is before trying your fix.


    jnewbery commented at 4:03 PM on March 29, 2017:

    sigh. sync_with_ping() doesn't assert that the node has sync'ed. It's up to the caller to assert on the return value. Sadly, none of the test cases that call sync_with_ping() actually assert on the return value. Proposed fix here: https://github.com/bitcoin/bitcoin/pull/10114

  14. PastaPastaPasta referenced this in commit 2c276aa462 on Mar 14, 2019
  15. PastaPastaPasta referenced this in commit e64aa7f7ce on May 20, 2019
  16. PastaPastaPasta referenced this in commit 142b5cba0b on May 21, 2019
  17. PastaPastaPasta referenced this in commit 69334ae986 on May 21, 2019
  18. barrystyle referenced this in commit aaafc9b7e9 on Jan 22, 2020
  19. MarcoFalke locked this on Sep 8, 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: 2026-04-15 18:15 UTC

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