Add txindex=1 option to QA tests #7538

issue unsystemizer opened this issue on February 16, 2016
  1. unsystemizer commented at 1:46 PM on February 16, 2016: contributor

    I'd find it useful for workload testing if txindex= was an option in QA tests.
    For example, related to indexing, there's the reindex test but it takes just 2-3 seconds to run. (I'm not even sure if it any actual indexing takes place, but even if it does, it's meaningless from a workload testing perspective). It would be nice to be able to enable indexing. I tried inserting -txindex=1 in files such as qa/pull-tester/run-bitcoind-for-test.sh and qa/rpc-tests/test_framework/util.py, but I am still missing something because sooner or later I get this.

    Running testscript listtransactions.py...
    Initializing test directory /blockchain/tmp
    : You need to rebuild the database using -reindex to change -txindex.
    
    Do you want to rebuild the block database now?
    
  2. laanwj added the label Tests on Feb 16, 2016
  3. laanwj commented at 2:38 PM on February 16, 2016: member

    For example, related to indexing, there's the reindex test but it takes just 2-3 seconds to run.

    Tests running quickly is an advantage, not a problem. If there is no test for -txindex, it makes sense to add one. On the other hand I see no point to enable it for all tests.

    I am still missing something because sooner or later I get this.

    Try wiping any 'cache' directories.

  4. unsystemizer commented at 4:01 PM on February 16, 2016: contributor

    On the other hand I see no point to enable it for all tests. Tests running quickly is an advantage, not a problem

    Yes, I agree, I meant for all tests where it makes sense. For example invalidateblock.py seems different from reindex.py (the former is "dynamic", a real life situation during a reorg, while the latter is "static" and not something that's often used) so it'd be nice to have the option in applicable tests.

    I had wiped the cache (temp) dir and retried several times. I'll keep trying.

  5. laanwj commented at 8:43 AM on February 17, 2016: member

    I had wiped the cache (temp) dir and retried several times. I'll keep trying.

    Not sure how you intend this but: 'cache' is not the tmp directory, it gets created in the current directory IIRC, the tmp directory is copied from it, to not have to generate a new chain for every test

  6. unsystemizer commented at 10:43 AM on February 17, 2016: contributor

    Well you referred to it as "cache", I wasn't sure whether that's the same so I followed that with the term I saw in order to make sure we're on the same page. The tests by default use $TMP (/tmp/temp* in tests I ran) and a way to override that is qa/pull-tester/rpc-tests.sh -extended --tmpdir=/blockchain/tmp. What I do between different runs of extended tests (trying to see if changes to add txindex=1 have effect) is rm -rf /blockchain/tmp/*, that clears everything in there, although that appears to be the default unless one uses --nocleanup (https://github.com/bitcoin/bitcoin/blob/master/qa/rpc-tests/test_framework/test_framework.py#L101). I wouldn't clean it up every time if I could get txindex to work once - I'm doing it because I can't get that first batch of blockchain data (wallet.py) generated with txindex, which causes subsequent tests to suggest -reindex and hang in there.

  7. MarcoFalke commented at 7:46 AM on February 26, 2016: member

    I tried inserting -txindex=1 in files such as qa/pull-tester/run-bitcoind-for-test.sh and qa/rpc-tests/test_framework/util.py

    I'd prefer not to change defaults for all tests. What you could do, is to create a test similar to reindex.py

  8. unsystemizer commented at 6:16 PM on February 26, 2016: contributor

    That's fine, whatever is reasonable.

  9. laanwj commented at 11:01 AM on April 28, 2016: member

    Closing this. I think having a test for transaction index would be good, but there's no need to keep this issue open.

  10. laanwj closed this on Apr 28, 2016

  11. 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 15:15 UTC

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