tests: Avoid read/write to default datadir #13663

pull MarcoFalke wants to merge 2 commits into bitcoin:master from MarcoFalke:Mf1807-qaNoDefaultDatadir changing 2 files +15 −0
  1. MarcoFalke commented at 2:48 PM on July 14, 2018: member

    tests should never read or write and potentially corrupt the default datadir, so try to avoid it.

  2. test_bitcoin: Avoid read/write to default datadir ea80b81e2e
  3. bench_bitcoin: Avoid read/write to default datadir fa43a4138b
  4. MarcoFalke added the label Tests on Jul 14, 2018
  5. MarcoFalke added this to the milestone 0.17.0 on Jul 14, 2018
  6. practicalswift commented at 11:28 PM on July 15, 2018: contributor

    Concept ACK

  7. MarcoFalke force-pushed on Jul 16, 2018
  8. MarcoFalke force-pushed on Jul 16, 2018
  9. MarcoFalke commented at 7:59 PM on July 16, 2018: member

    Added a commit to .travis.yml that fails when applied to current master

  10. in .travis.yml:56 in fa2e42523e outdated
      52 | @@ -53,6 +53,7 @@ install:
      53 |      - travis_retry DOCKER_EXEC apt-get update
      54 |      - travis_retry DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES $DOCKER_PACKAGES
      55 |  before_script:
      56 | +    - DOCKER_EXEC [ ! -d \$HOME/.bitcoin ]  # Make sure default datadir does not exist
    


    promag commented at 8:38 PM on July 16, 2018:

    WDYT about creating a dummy file? It would cause failure if used right?


    MarcoFalke commented at 9:25 PM on July 16, 2018:

    Indeed. That would then give a nice bt in case of failure. Thanks

        - DOCKER_EXEC echo \> \$HOME/.bitcoin  # Make sure default datadir does not exist and is never read by creating a dummy file
    
  11. MarcoFalke force-pushed on Jul 16, 2018
  12. MarcoFalke force-pushed on Jul 16, 2018
  13. MarcoFalke force-pushed on Jul 16, 2018
  14. MarcoFalke commented at 9:26 PM on July 16, 2018: member

    Reverted to my initial solution, since the functional tests are still broken. Can be fixed in a future pull...

  15. promag commented at 10:09 PM on July 16, 2018: member

    @MarcoFalke makes sense to fix everything here no?

  16. MarcoFalke commented at 1:13 AM on July 17, 2018: member

    I have no idea how to fix the broken functional test cross platform without removing it.

  17. MarcoFalke commented at 1:15 AM on July 17, 2018: member

    Note the failing test: https://travis-ci.org/bitcoin/bitcoin/jobs/404617285#L3068

     File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-i686-pc-linux-gnu/test/functional/feature_config_args.py", line 39, in run_test
        self.nodes[0].assert_start_raises_init_error(['-conf=' + conf_file], 'Error reading configuration file: specified data directory "' + new_data_dir + '" does not exist.')
    
  18. sipa commented at 7:28 AM on July 17, 2018: member

    Concept ACK

  19. laanwj commented at 11:41 AM on July 17, 2018: member

    Strange - I thought we already checked this in travis.

    Anyhow thanks for fixing this again. utACK fa43a4138b4a652bd83d70536539ae2aded05f0c

  20. MarcoFalke referenced this in commit cbc9b50734 on Jul 17, 2018
  21. MarcoFalke merged this on Jul 17, 2018
  22. MarcoFalke closed this on Jul 17, 2018

  23. MarcoFalke deleted the branch on Jul 17, 2018
  24. PastaPastaPasta referenced this in commit 35b58bf4a0 on Dec 16, 2020
  25. PastaPastaPasta referenced this in commit d60c3538d4 on Dec 18, 2020
  26. PastaPastaPasta referenced this in commit 16591be580 on Dec 18, 2020
  27. MarcoFalke locked this on Sep 8, 2021
Labels

Milestone
0.17.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-17 06:15 UTC

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