test: call VerifyLoadedChainstate during ChainTestingSetup #23736

pull jamesob wants to merge 1 commits into bitcoin:master from jamesob:2021-12-verify-loaded-cs-test changing 1 files +10 −0
  1. jamesob commented at 4:48 pm on December 10, 2021: member

    for additional coverage and similarity to actual init process.

    Followup to #23280.

  2. DrahtBot added the label Tests on Dec 10, 2021
  3. in src/test/util/setup_common.cpp:187 in 1c6f4e6fe0 outdated
    186@@ -187,6 +187,16 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
    187         throw std::runtime_error("LoadGenesisBlock failed.");
    


    MarcoFalke commented at 8:27 am on December 11, 2021:
    please rebase this on master, otherwise it is needlessly hard to review. I suspect this doesn’t even compile?

    jamesob commented at 1:24 pm on December 13, 2021:
    Not sure I follow, but it’s been rebased.

    MarcoFalke commented at 1:40 pm on December 13, 2021:

    To see if a commit compiles locally, you can use make. For example this commit indeed fails:

     0$ git checkout 1c6f4e6fe07bb111dd40e6ebfb8936f49a51c2e3 && make 
     1HEAD is now at 1c6f4e6fe0 test: call VerifyLoadedChainstate during ChainTestingSetup
     2Making all in src
     3make[1]: Entering directory '/home/marco/workspace/btc_bitcoin_core/src'
     4make[2]: Entering directory '/home/marco/workspace/btc_bitcoin_core/src'
     5make[3]: Entering directory '/home/marco/workspace/btc_bitcoin_core'
     6make[3]: Leaving directory '/home/marco/workspace/btc_bitcoin_core'
     7  CXX      test/util/libtest_util_a-setup_common.o
     8test/util/setup_common.cpp:192:9: error: use of undeclared identifier 'fReindex'
     9        fReindex.load(),
    10        ^
    111 error generated.
    12make[2]: *** [Makefile:11221: test/util/libtest_util_a-setup_common.o] Error 1
    13make[2]: Leaving directory '/home/marco/workspace/btc_bitcoin_core/src'
    14make[1]: *** [Makefile:17227: all-recursive] Error 1
    15make[1]: Leaving directory '/home/marco/workspace/btc_bitcoin_core/src'
    16make: *** [Makefile:817: all-recursive] Error 1
    
  4. jamesob force-pushed on Dec 13, 2021
  5. in src/test/util/setup_common.cpp:198 in ad0cf78f76 outdated
    194@@ -195,6 +195,16 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
    195                              true);
    196     assert(!rv.has_value());
    197 
    198+    auto rv2 = VerifyLoadedChainstate(
    


    MarcoFalke commented at 1:23 pm on December 13, 2021:
    any reason to call this rv instead of something that makes sense?
  6. in src/test/util/setup_common.cpp:199 in ad0cf78f76 outdated
    194@@ -195,6 +195,16 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
    195                              true);
    196     assert(!rv.has_value());
    197 
    198+    auto rv2 = VerifyLoadedChainstate(
    199+        *Assert(m_node.chainman.get()),
    


    MarcoFalke commented at 1:25 pm on December 13, 2021:
    0        *Assert(m_node.chainman),
    

    I think this should also compile?

  7. in src/test/util/setup_common.cpp:205 in ad0cf78f76 outdated
    200+        fReindex.load(),
    201+        m_args.GetBoolArg("-reindex-chainstate", false),
    202+        chainparams.GetConsensus(),
    203+        m_args.GetIntArg("-checkblocks", DEFAULT_CHECKBLOCKS),
    204+        m_args.GetIntArg("-checklevel", DEFAULT_CHECKLEVEL),
    205+        GetAdjustedTime);
    


    MarcoFalke commented at 1:28 pm on December 13, 2021:
    What is the reason to use this time?
  8. MarcoFalke commented at 1:28 pm on December 13, 2021: member
    some q
  9. jamesob force-pushed on Dec 13, 2021
  10. jamesob commented at 2:03 pm on December 13, 2021: member
    @MarcoFalke all fixed, thanks.
  11. test: call VerifyLoadedChainstate during ChainTestingSetup
    for additional coverage and similarity to actual init process.
    826e12b010
  12. jamesob force-pushed on Dec 13, 2021
  13. jamesob commented at 2:18 pm on December 20, 2021: member
    Should be a pretty easy review… @dongcarl maybe?
  14. ryanofsky approved
  15. ryanofsky commented at 2:40 pm on December 20, 2021: member
    Code review ACK 826e12b010eda4238f9e8cd875e8915a405bed0d
  16. dongcarl commented at 11:08 pm on December 20, 2021: member
    Code Review ACK 826e12b010eda4238f9e8cd875e8915a405bed0d
  17. jamesob commented at 7:43 pm on December 22, 2021: member
    Ready for merge?
  18. fanquake merged this on Dec 23, 2021
  19. fanquake closed this on Dec 23, 2021

  20. sidhujag referenced this in commit 99d9e47d60 on Dec 27, 2021
  21. DrahtBot locked this on Dec 23, 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: 2024-07-03 13:13 UTC

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