[tests] log thread names by default in functional tests #15927

pull jnewbery wants to merge 2 commits into bitcoin:master from jnewbery:2019-04-log-threads-tests changing 1 files +4 −0
  1. jnewbery commented at 8:19 PM on April 30, 2019: member

    More detailed logs are better

  2. [tests] log thread names by default in functional tests ba534ccd56
  3. MarcoFalke commented at 8:25 PM on April 30, 2019: member

    Should add a comment to initialize_datadir to explain why logging related configs should not go into the conf file?

  4. DrahtBot added the label Tests on Apr 30, 2019
  5. jnewbery commented at 8:40 PM on April 30, 2019: member

    @MarcoFalke - is there a good reason? Is it just so these options get picked up before the conf file is read?

  6. MarcoFalke commented at 9:15 PM on April 30, 2019: member

    I think it was something like "I don't want logging to be verbose and spam the debug.log when I start a regtest node in the temp dir for debugging after a test failure"

  7. practicalswift commented at 6:48 AM on May 1, 2019: contributor

    Concept ACK

  8. laanwj commented at 10:22 AM on May 1, 2019: member

    I think it was something like "I don't want logging to be verbose and spam the debug.log when I start a regtest node in the temp dir for debugging after a test failure"

    Would definitely make sense to add a comment then. This is far from obvious, especially for new contributors.

    Concept ACK ofc.

  9. [tests] Comment for why logging config is set as command-line args. 7b29ec277b
  10. jnewbery commented at 4:47 PM on May 3, 2019: member

    Should add a comment to initialize_datadir to explain why logging related configs should not go into the conf file?

    Added comment as requested.

  11. jonatack commented at 10:53 AM on May 6, 2019: member

    Hi John, I tried to test this (recompiled, ran various functional tests, added changes to make them fail), and was unable to find a change in logging. Could you give an example I can run of where this makes a difference?

  12. MarcoFalke commented at 1:22 PM on May 6, 2019: member

    @jonatack Good catch. I suggest to extend some assert_debug_log with a string that also matches the thread name. Maybe in script checking or net?

  13. jnewbery commented at 4:48 PM on May 6, 2019: member

    Note that logthreadnames does not work on mingw32 and darwin.

    I've verified that this works for me. Before:

    head /tmp/user/1000/bitcoin_func_test_4apf_c6t/node0/regtest/debug.log
    2019-05-06T16:44:58Z 
    
    
    
    
    2019-05-06T16:44:58.838174Z Bitcoin Core version v0.18.99.0-unk (release build)
    2019-05-06T16:44:58.838180Z InitParameterInteraction: parameter interaction: -bind set -> setting -listen=1
    2019-05-06T16:44:58.838216Z Validating signatures for all blocks.
    2019-05-06T16:44:58.838220Z Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000000000000
    2019-05-06T16:44:58.838283Z Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation
    

    After:

    head -10 /tmp/user/1000/bitcoin_func_test_aihi949j/node0/regtest/debug.log 
    2019-05-06T16:28:51Z 
    
    
    
    
    2019-05-06T16:28:51.180256Z [init] Bitcoin Core version v0.18.99.0-unk (release build)
    2019-05-06T16:28:51.180272Z [init] InitParameterInteraction: parameter interaction: -bind set -> setting -listen=1
    2019-05-06T16:28:51.180392Z [init] Validating signatures for all blocks.
    2019-05-06T16:28:51.180404Z [init] Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000000000000
    2019-05-06T16:28:51.180553Z [init] Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation
    

    (note the [init] prefix on the log lines).

    I suggest to extend some assert_debug_log with a string that also matches the thread name.

    This would break the functional tests on platforms that don't support -logthreadnames

  14. MarcoFalke commented at 4:58 PM on May 6, 2019: member

    Oh, yeah. Would have to add to test/.config.ini ...

    Not asking you to do it here, though.

  15. MarcoFalke merged this on May 6, 2019
  16. MarcoFalke closed this on May 6, 2019

  17. MarcoFalke referenced this in commit 8ec7121a45 on May 6, 2019
  18. jnewbery deleted the branch on May 6, 2019
  19. sidhujag referenced this in commit a31e3a44c8 on May 10, 2019
  20. deadalnix referenced this in commit 05960024a5 on Jul 30, 2020
  21. kittywhiskers referenced this in commit 5219112dee on Nov 3, 2021
  22. kittywhiskers referenced this in commit 147b0a753b on Nov 4, 2021
  23. kittywhiskers referenced this in commit f9d5542daa on Nov 11, 2021
  24. pravblockc referenced this in commit 8bedc30432 on Nov 18, 2021
  25. MarcoFalke locked this on Dec 16, 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-30 12:14 UTC

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