test: Create cached blocks not in the future #18641

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2004-qaNoCacheFuture changing 1 files +7 −3
  1. MarcoFalke commented at 1:08 AM on April 15, 2020: member

    This avoids test failures when tests assume blocks are not from the future, like in wallet_dump: https://cirrus-ci.com/task/6607130193035264?command=ci#L3306

  2. test: Create cached blocks not in the future fa32097541
  3. fanquake added the label Tests on Apr 15, 2020
  4. MarcoFalke commented at 1:50 AM on April 15, 2020: member
  5. jonatack commented at 4:35 PM on April 17, 2020: member

    What caused the failures to begin occurring?

  6. MarcoFalke commented at 4:58 PM on April 17, 2020: member

    A newly added test in wallet_dump.py

  7. jonatack commented at 5:00 PM on April 17, 2020: member

    Ok -- 555567ac. Looking, and running all the tests locally against this right now.

  8. in test/functional/test_framework/test_framework.py:572 in fa32097541
     569 |                      nblocks=25 if i != 7 else 24,
     570 |                      address=TestNode.PRIV_KEYS[i % 4].address,
     571 |                  )
     572 |  
     573 | -            assert_equal(self.nodes[CACHE_NODE_ID].getblockchaininfo()["blocks"], 199)
     574 | +            assert_equal(cache_node.getblockchaininfo()["blocks"], 199)
    


    jonatack commented at 5:20 PM on April 17, 2020:

    while touching this, maybe simplify?

    -            assert_equal(self.nodes[CACHE_NODE_ID].getblockchaininfo()["blocks"], 199)
    +            assert_equal(self.nodes[CACHE_NODE_ID].getblockcount(), 199)
    

    huanhd400 commented at 5:38 PM on April 17, 2020:

    Ok

  9. jonatack commented at 5:25 PM on April 17, 2020: member

    I'm tentatively seeing failures in wallet_multiwallet with and without --usecli, not sure if related... rebuilding with make clean to be sure.

  10. MarcoFalke commented at 5:29 PM on April 17, 2020: member

    Did you run make distclean && make before executing the tests?

  11. jonatack commented at 5:35 PM on April 17, 2020: member

    ACK fa320975411af4f0e41771d89958a77fd7a2284b

  12. jonatack commented at 5:38 PM on April 17, 2020: member

    Yep, sorry, I needed to make clean.

    I've been reusing my ./configure, then redoing with make clean if seeing issues, or starting straight away with make distclean when switching between gcc and clang. Do you generally begin with make distclean?

  13. MarcoFalke commented at 5:45 PM on April 17, 2020: member

    This is my bash alias:

    ./autogen.sh && ./configure && make distclean && ./configure CC=clang CXX=clang++ && make -j 9 check
    
  14. jonatack commented at 5:54 PM on April 17, 2020: member

    Thanks... ./configure twice? Mine are here: https://github.com/jonatack/dotfiles/blob/master/bash_aliases#L331

  15. MarcoFalke commented at 5:57 PM on April 17, 2020: member

    Jup, this way it works on any repo state, even after git clean -dfx

  16. jonatack commented at 6:05 PM on April 17, 2020: member

    Thanks!

    +alias marco='./autogen.sh && ./configure && make distclean && ./configure CC=clang CXX=clang++ && make -j 5 check'
    
  17. MarcoFalke commented at 6:06 PM on April 17, 2020: member

    lol

  18. MarcoFalke merged this on Apr 17, 2020
  19. MarcoFalke closed this on Apr 17, 2020

  20. MarcoFalke deleted the branch on Apr 17, 2020
  21. sidhujag referenced this in commit ba32b232d3 on Apr 17, 2020
  22. deadalnix referenced this in commit aff6784475 on May 14, 2020
  23. DrahtBot locked this on Feb 15, 2022

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-17 06:14 UTC

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