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.
Friendly ping @LarryRuane (as a test author) and @ryanofsky (as an ArgsManager expert).
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!
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>());
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)?
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.
ACK c8f91478c10affdfba8e52200c85379052f4e1b1