test: Avoid collision with valid path names in `getarg_tests/logargs` #26473

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:221108-logargs changing 1 files +2 −2
  1. hebasto commented at 7:05 PM on November 8, 2022: member

    This PR prevents test failure when "private" is a part of a valid path.

    For example, /private/var is a valid path on macOS for temporary files, which in turn causes test failure on CI for tests managed by the CTest framework.

  2. hebasto added the label Tests on Nov 8, 2022
  3. hebasto commented at 7:09 PM on November 8, 2022: member

    Friendly ping @LarryRuane (as a test author) and @ryanofsky (as an ArgsManager expert).

  4. LarryRuane commented at 10:31 PM on November 8, 2022: contributor

    tACK 400fa45d5df0d5c90d246ce3f0cf5281b69827b7 It would also be okay if, instead of dynamic random data, we just used a very unlikely (but still fixed) string. Thanks for fixing this!

  5. in src/test/getarg_tests.cpp:433 in 400fa45d5d outdated
     429 | @@ -428,8 +430,9 @@ BOOST_AUTO_TEST_CASE(logargs)
     430 |      const auto okaylog_negbool = std::make_pair("-okaylog-negbool", ArgsManager::ALLOW_ANY);
     431 |      const auto okaylog = std::make_pair("-okaylog", ArgsManager::ALLOW_ANY);
     432 |      const auto dontlog = std::make_pair("-dontlog", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE);
     433 | +    const auto private_data = strprintf("%04x", GetRand<uint16_t>());
    


    maflcko commented at 6:48 AM on November 9, 2022:

    Why does this need to be random? Given that the test already failed on one platform, how is this not going to introduce a non-deterministic intermittent issue on the same platform (or others)?


    hebasto commented at 9:35 AM on November 9, 2022:

    Thanks! Updated.

  6. test: Avoid collision with valid path names in `getarg_tests/logargs` c8f91478c1
  7. hebasto force-pushed on Nov 9, 2022
  8. hebasto renamed this:
    test: Randomize data in `getarg_tests/logargs` test
    test: Avoid collision with valid path names in `getarg_tests/logargs`
    on Nov 9, 2022
  9. hebasto commented at 9:34 AM on November 9, 2022: member

    Updated 400fa45d5df0d5c90d246ce3f0cf5281b69827b7 -> c8f91478c10affdfba8e52200c85379052f4e1b1 (pr26473.01 -> pr26473.02, diff).

    It would also be okay if, instead of dynamic random data, we just used a very unlikely (but still fixed) string.

    Done.

  10. maflcko commented at 11:14 AM on November 9, 2022: member

    ACK c8f91478c10affdfba8e52200c85379052f4e1b1

  11. maflcko merged this on Nov 9, 2022
  12. maflcko closed this on Nov 9, 2022

  13. hebasto deleted the branch on Nov 9, 2022
  14. sidhujag referenced this in commit 9296034a34 on Nov 9, 2022
  15. bitcoin locked this on Nov 9, 2023

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-24 21:13 UTC

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