test: Remove spam from debug log #26408

pull jbrr wants to merge 1 commits into bitcoin:master from jbrr:2210-fix-noisy-tests changing 1 files +1 −0
  1. jbrr commented at 7:19 AM on October 28, 2022: contributor

    Currently, debug.log is spammed with messages like this from random.cpp when functional tests are run.

    2022-10-25T19:24:34.787663Z [scheduler] [random.cpp:519] [SeedPeriodic] [rand] Feeding 36565 bytes of dynamic environment data into RNG
    

    These logs are not useful for debugging and decrease the signal-to-noise ratio of the logs, so they should be suppressed by excluding the rand category, as the libevent and leveldb categories currently are.

  2. Exclude rand from debug log
    Currently, debug.log is spammed with messages from random.cpp
    when functional tests are run. These logs are not useful for
    debugging, and decrease the signal to noise ratio of the logs.
    ef97b89902
  3. DrahtBot added the label Tests on Oct 28, 2022
  4. LarryRuane commented at 1:58 PM on October 28, 2022: contributor

    ACK ef97b89902f03d710f6111a1d8deaaa87d92a817 Tested that the patch does eliminate the logging lines quoted in the description. I think this is a useful change because those log entries add little to no value. Eliminating them makes the logs easier to read when writing or understanding functional tests (I do this often myself).

  5. kouloumos commented at 3:18 PM on October 28, 2022: contributor

    ACK ef97b89902f03d710f6111a1d8deaaa87d92a817, confirmed that this log level is only used in random.cpp and indeed it seems that it doesn't add any value to the debug.log during functional tests.

  6. satsie commented at 8:45 PM on October 28, 2022: contributor

    ACK ef97b89902f03d710f6111a1d8deaaa87d92a817

    Confirmed what kouloumos said about this log level only appearing in random.cpp:

    grep -r -i --color='always' 'BCLog::RAND' .
    ./bitcoin/src/logging.cpp:    {BCLog::RAND, "rand"},
    ./bitcoin/src/random.cpp:    LogPrint(BCLog::RAND, "Feeding %i bytes of dynamic environment data into RNG\n", hasher.Size() - old_size);
    ./bitcoin/src/random.cpp:    LogPrint(BCLog::RAND, "Feeding %i bytes of environment data into RNG\n", hasher.Size() - old_size);
    

    Applied the code change an observed that the rand debug logs are no longer appearing for bitcoind instances that the functional tests start up. Suppressing them feels like a good idea because it makes the debug logs easier to read. The likelihood that someone needs these log statements for testing is very small compared to the amount of the tests where these log messages are just noise.

  7. theStack approved
  8. theStack commented at 7:35 AM on October 29, 2022: contributor

    ACK ef97b89902f03d710f6111a1d8deaaa87d92a817

    Verified the effect of the PR by running ./test/functional/p2p_segwit.py --nocleanup and comparing debug.log files (on the short-running tests there was no difference). Also checked that the debug messages belonging to the excluded RAND category are indeed not needed for analyzing functional tests.

    Warm welcome as a new contributor!

  9. maflcko merged this on Oct 29, 2022
  10. maflcko closed this on Oct 29, 2022

  11. sidhujag referenced this in commit bf243acf4d on Oct 30, 2022
  12. jbrr commented at 3:10 PM on October 31, 2022: contributor

    Thanks for all the quick feedback, and thanks for the warm welcome @theStack!

  13. in test/functional/test_framework/test_node.py:105 in ef97b89902
     101 | @@ -102,6 +102,7 @@ def __init__(self, i, datadir, *, chain, rpchost, timewait, timeout_factor, bitc
     102 |              "-debug",
     103 |              "-debugexclude=libevent",
     104 |              "-debugexclude=leveldb",
     105 | +            "-debugexclude=rand",
    


    jonatack commented at 5:10 PM on November 2, 2022:

    Currently, debug.log is spammed with messages like this from random.cpp when functional tests are run.

    These logs are not useful for debugging and decrease the signal-to-noise ratio of the logs, so they should be suppressed by excluding the rand category, as the libevent and leveldb categories currently are.

    Note that the libevent and leveldb categories are external libraries, whereas src/random.{h,cpp} is logging from our own code.

  14. bitcoin locked this on Nov 6, 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-05-02 03:13 UTC

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