test: feature_block exits successfully even on failure #16744

issue MarcoFalke opened this issue on August 28, 2019
  1. MarcoFalke commented at 6:55 PM on August 28, 2019: member

    Current master:

    $ ./test/functional/feature_block.py 
    2019-08-28T18:52:04.162000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_60qfesr8
    2019-08-28T18:52:04.992000Z TestFramework (INFO): Reject block with invalid tx: OutputMissing
    2019-08-28T18:52:05.156000Z TestFramework (INFO): Reject block with invalid tx: InputMissing
    2019-08-28T18:52:05.310000Z TestFramework (INFO): Reject block with invalid tx: BadInputOutpointIndex
    2019-08-28T18:52:05.475000Z TestFramework (INFO): Reject block with invalid tx: DuplicateInput
    2019-08-28T18:52:05.641000Z TestFramework (INFO): Reject block with invalid tx: NonexistentInput
    2019-08-28T18:52:05.806000Z TestFramework (INFO): Reject block with invalid tx: SpendTooMuch
    2019-08-28T18:52:05.967000Z TestFramework (INFO): Reject block with invalid tx: SpendNegative
    2019-08-28T18:52:06.131000Z TestFramework (INFO): Reject block with invalid tx: TooManySigops
    2019-08-28T18:52:06.323000Z TestFramework (INFO): Don't reorg to a chain of the same length
    2019-08-28T18:52:06.436000Z TestFramework (INFO): Reorg to a longer chain
    2019-08-28T18:52:06.655000Z TestFramework (INFO): Reorg back to the original chain
    2019-08-28T18:52:06.767000Z TestFramework (INFO): Reject a chain with a double spend, even if it is longer
    2019-08-28T18:52:07.033000Z TestFramework (INFO): Reject a block where the miner creates too much coinbase reward
    2019-08-28T18:52:07.197000Z TestFramework (INFO): Reject a chain where the miner creates too much coinbase reward, even if the chain is longer
    2019-08-28T18:52:07.469000Z TestFramework (INFO): Reject a chain where the miner creates too much coinbase reward, even if the chain is longer (on a forked chain)
    2019-08-28T18:52:07.662000Z TestFramework (INFO): Accept a block with lots of checksigs
    2019-08-28T18:52:07.802000Z TestFramework (INFO): Reject a block with too many checksigs
    2019-08-28T18:52:07.992000Z TestFramework (INFO): Reject a block with a spend from a re-org'ed out tx
    2019-08-28T18:52:08.146000Z TestFramework (INFO): Reject a block with a spend from a re-org'ed out tx (on a forked chain)
    2019-08-28T18:52:08.412000Z TestFramework (INFO): Reject a block spending an immature coinbase.
    2019-08-28T18:52:08.572000Z TestFramework (INFO): Reject a block spending an immature coinbase (on a forked chain)
    2019-08-28T18:52:08.849000Z TestFramework (INFO): Accept a block of size MAX_BLOCK_BASE_SIZE
    2019-08-28T18:52:08.991000Z TestFramework (INFO): Reject a block of size MAX_BLOCK_BASE_SIZE + 1
    2019-08-28T18:52:09.296000Z TestFramework (INFO): Reject a block with coinbase input script size out of range
    2019-08-28T18:52:09.954000Z TestFramework (INFO): Accept a block with the max number of OP_CHECKMULTISIG sigops
    2019-08-28T18:52:10.064000Z TestFramework (INFO): Reject a block with too many OP_CHECKMULTISIG sigops
    2019-08-28T18:52:10.228000Z TestFramework (INFO): Accept a block with the max number of OP_CHECKMULTISIGVERIFY sigops
    2019-08-28T18:52:10.342000Z TestFramework (INFO): Reject a block with too many OP_CHECKMULTISIGVERIFY sigops
    2019-08-28T18:52:10.501000Z TestFramework (INFO): Accept a block with the max number of OP_CHECKSIGVERIFY sigops
    2019-08-28T18:52:10.617000Z TestFramework (INFO): Reject a block with too many OP_CHECKSIGVERIFY sigops
    2019-08-28T18:52:10.782000Z TestFramework (INFO): Reject a block spending transaction from a block which failed to connect
    2019-08-28T18:52:11.093000Z TestFramework (INFO): Check P2SH SIGOPS are correctly counted
    2019-08-28T18:52:13.071000Z TestFramework (INFO): Reject a block with too many P2SH sigops
    2019-08-28T18:52:24.072000Z TestFramework (INFO): Accept a block with the max number of P2SH sigops
    2019-08-28T18:52:25.132000Z TestFramework (INFO): Build block 44 manually
    2019-08-28T18:52:25.239000Z TestFramework (INFO): Reject a block with a non-coinbase as the first tx
    2019-08-28T18:52:25.396000Z TestFramework (INFO): Reject a block with no transactions
    2019-08-28T18:52:25.549000Z TestFramework (INFO): Reject a block with invalid work
    2019-08-28T18:52:25.705000Z TestFramework (INFO): Reject a block with a timestamp >2 hours in the future
    2019-08-28T18:52:25.759000Z TestFramework (INFO): Reject a block with invalid merkle hash
    2019-08-28T18:52:25.912000Z TestFramework (INFO): Reject a block with incorrect POW limit
    2019-08-28T18:52:26.066000Z TestFramework (INFO): Reject a block with two coinbase transactions
    2019-08-28T18:52:26.223000Z TestFramework (INFO): Reject a block with duplicate transactions
    2019-08-28T18:52:26.500000Z TestFramework (INFO): Reject a block with timestamp before MedianTimePast
    2019-08-28T18:52:26.788000Z TestFramework (INFO): Reject a block with a duplicate transaction in the Merkle Tree (but with a valid Merkle Root)
    2019-08-28T18:52:26.952000Z TestFramework (INFO): Reject a block with two duplicate transactions in the Merkle Tree (but with a valid Merkle Root)
    2019-08-28T18:52:27.314000Z TestFramework (INFO): Reject a block with a transaction with prevout.n out of range
    2019-08-28T18:52:27.474000Z TestFramework (INFO): Reject a block with a transaction with outputs > inputs
    2019-08-28T18:52:27.741000Z TestFramework (INFO): Reject a block with a transaction with a duplicate hash of a previous transaction (BIP30)
    2019-08-28T18:52:28.007000Z TestFramework (INFO): Reject a block with a transaction with a nonfinal locktime
    2019-08-28T18:52:28.161000Z TestFramework (INFO): Reject a block with a coinbase transaction with a nonfinal locktime
    2019-08-28T18:52:28.318000Z TestFramework (INFO): Accept a valid block even if a bloated version of the block has previously been sent
    2019-08-28T18:52:28.628000Z TestFramework (INFO): Accept a block with a transaction spending an output created in the same block
    2019-08-28T18:52:28.741000Z TestFramework (INFO): Reject a block with a transaction spending an output created later in the same block
    2019-08-28T18:52:28.899000Z TestFramework (INFO): Reject a block with a transaction double spending a transaction created in the same block
    2019-08-28T18:52:29.059000Z TestFramework (INFO): Reject a block trying to claim too much subsidy in the coinbase transaction
    2019-08-28T18:52:29.223000Z TestFramework (INFO): Accept a block claiming the correct subsidy in the coinbase transaction
    2019-08-28T18:52:29.338000Z TestFramework (INFO): Reject a block containing a transaction spending from a non-existent input
    2019-08-28T18:52:29.496000Z TestFramework (INFO): Reject a block containing a duplicate transaction but with the same Merkle root (Merkle tree malleability
    2019-08-28T18:52:29.764000Z TestFramework (INFO): Reject a block containing too many sigops after a large script element
    2019-08-28T18:52:29.933000Z TestFramework (INFO): Check sigops are counted correctly after an invalid script element
    2019-08-28T18:52:30.329000Z TestFramework (INFO): Test transaction resurrection during a re-org
    2019-08-28T18:52:30.887000Z TestFramework (INFO): Accept a block with invalid opcodes in dead execution paths
    2019-08-28T18:52:31.007000Z TestFramework (INFO): Test re-orging blocks with OP_RETURN in them
    2019-08-28T18:52:31.732000Z TestFramework (INFO): Test a re-org of one week's worth of blocks (1088 blocks)
    2019-08-28T18:52:58.931000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
            def test_function():
                assert self.is_connected
                return self.last_message.get("pong") and self.last_message["pong"].nonce == self.ping_counter
    '''
    2019-08-28T18:53:07.860000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
            def test_function():
                assert self.is_connected
                return self.last_message.get("pong") and self.last_message["pong"].nonce == self.ping_counter
    '''
    2019-08-28T18:53:07.862000Z TestFramework (INFO): Reject a block with an invalid block header version
    2019-08-28T18:53:12.433000Z TestFramework (INFO): Stopping nodes
    2019-08-28T18:53:12.686000Z TestFramework (INFO): Cleaning up /tmp/bitcoin_func_test_60qfesr8 on exit
    2019-08-28T18:53:12.686000Z TestFramework (INFO): Tests successful
    
    
    
    $ echo $?
    0
    
  2. MarcoFalke commented at 7:04 PM on August 28, 2019: member

    Calling "git revert 6011c9d72d1df5c2cd09de6f85c21eb4f7eb1ba8" fixes the bug

    It can be tested easily by lowering the timeout, so that is always hits:

    diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py
    index 779863df79..81c947f310 100755
    --- a/test/functional/test_framework/mininode.py
    +++ b/test/functional/test_framework/mininode.py
    @@ -568,7 +568,7 @@ class P2PDataStore(P2PInterface):
                 if expect_disconnect:
                     self.wait_for_disconnect(timeout=timeout)
                 else:
    -                self.sync_with_ping(timeout=timeout)
    +                self.sync_with_ping(timeout=1)
     
                 if success:
                     wait_until(lambda: node.getbestblockhash() == blocks[-1].hash, timeout=timeout)
    
  3. MarcoFalke added the label good first issue on Aug 28, 2019
  4. MarcoFalke added the label Tests on Aug 28, 2019
  5. MarcoFalke added this to the milestone 0.19.0 on Aug 28, 2019
  6. Shubhamchinda commented at 6:31 PM on August 29, 2019: none

    Can I take this?

  7. MarcoFalke commented at 11:36 AM on September 3, 2019: member

    No need to ask if you want to solve this issue. I suspect the only thing you need is some python debugging skills.

  8. MarcoFalke referenced this in commit fa31b634a5 on Sep 4, 2019
  9. MarcoFalke commented at 5:15 PM on September 4, 2019: member

    Addressed in #16804

  10. MarcoFalke closed this on Sep 4, 2019

  11. MarcoFalke locked this on Dec 16, 2021

Milestone
0.19.0


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-14 18:14 UTC

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