Intermittent issue in feature_index_prune.py: assert_equal(pruneheight_new, 248) AssertionError: not(249 == 248) #31446

issue maflcko openend this issue on December 9, 2024
  1. maflcko commented at 3:29 pm on December 9, 2024: member

    https://cirrus-ci.com/task/5093097040773120?logs=ci#L2925

    0[05:55:03.695]  test  2024-12-03T05:55:02.834000Z TestFramework (ERROR): Assertion failed 
    1[05:55:03.695]                                    Traceback (most recent call last):
    2[05:55:03.695]                                      File "/ci_container_base/test/functional/test_framework/test_framework.py", line 135, in main
    3[05:55:03.695]                                        self.run_test()
    4[05:55:03.695]                                      File "/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/test/functional/feature_index_prune.py", line 77, in run_test
    5[05:55:03.695]                                        assert_equal(pruneheight_new, 248)
    6[05:55:03.695]                                      File "/ci_container_base/test/functional/test_framework/util.py", line 77, in assert_equal
    7[05:55:03.695]                                        raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
    8[05:55:03.695]                                    AssertionError: not(249 == 248)
    
  2. maflcko commented at 3:29 pm on December 9, 2024: member
  3. maflcko added the label CI failed on Dec 9, 2024
  4. mzumsande commented at 9:01 pm on December 10, 2024: contributor

    This is due to the possibility of blocks arriving out of order, even when syncing with just one peer:

    As node 0 generates blocks, it sends out cmpctblock messages to its peers. In response to this, node 1 will either reconstruct the blocks/write them to disk directly or (if it’s slow in keeping up, and its tip is behind so that it sees the announcements as in the future) request them via GETDATA, adding a round trip. Therefore, blocks can be saved to disk out of order for node 1, and if that happens with the last block of the block file, the prune height can be different for one of the blocks receiving blocks via p2p.

    Not sure how to best fix this - I thought about just softening the assertions for the pruning height, but possibly the later subtest “prune exactly up to the indices best blocks while the indices are disabled” could fail due to that same effect?

  5. maflcko commented at 9:28 pm on December 10, 2024: member

    I guess it could use a “dumb” sync instead of the P2P sync. Similar to:

     0$ git grep --line-number -A18 'def dumb_sync'
     1test/functional/wallet_upgradewallet.py:78:    def dumb_sync_blocks(self):
     2test/functional/wallet_upgradewallet.py-79-        """
     3test/functional/wallet_upgradewallet.py-80-        Little helper to sync older wallets.
     4test/functional/wallet_upgradewallet.py-81-        Notice that v0.15.2's regtest is hardforked, so there is
     5test/functional/wallet_upgradewallet.py-82-        no sync for it.
     6test/functional/wallet_upgradewallet.py-83-        v0.15.2 is only being used to test for version upgrade
     7test/functional/wallet_upgradewallet.py-84-        and master hash key presence.
     8test/functional/wallet_upgradewallet.py-85-        v0.16.3 is being used to test for version upgrade and balances.
     9test/functional/wallet_upgradewallet.py-86-        Further info: [#18774 (review)](/bitcoin-bitcoin/18774/#discussion_r416967844)
    10test/functional/wallet_upgradewallet.py-87-        """
    11test/functional/wallet_upgradewallet.py-88-        node_from = self.nodes[0]
    12test/functional/wallet_upgradewallet.py-89-        v16_3_node = self.nodes[1]
    13test/functional/wallet_upgradewallet.py-90-        to_height = node_from.getblockcount()
    14test/functional/wallet_upgradewallet.py-91-        height = self.nodes[1].getblockcount()
    15test/functional/wallet_upgradewallet.py-92-        for i in range(height, to_height+1):
    16test/functional/wallet_upgradewallet.py-93-            b = node_from.getblock(blockhash=node_from.getblockhash(i), verbose=0)
    17test/functional/wallet_upgradewallet.py-94-            v16_3_node.submitblock(b)
    18test/functional/wallet_upgradewallet.py-95-        assert_equal(v16_3_node.getblockcount(), to_height)
    19test/functional/wallet_upgradewallet.py-96-
    

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-12-21 15:12 UTC

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