More detailed logs are better
[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-
jnewbery commented at 8:19 PM on April 30, 2019: member
-
[tests] log thread names by default in functional tests ba534ccd56
-
MarcoFalke commented at 8:25 PM on April 30, 2019: member
Should add a comment to
initialize_datadirto explain why logging related configs should not go into the conf file? - DrahtBot added the label Tests on Apr 30, 2019
-
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?
-
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"
-
practicalswift commented at 6:48 AM on May 1, 2019: contributor
Concept ACK
-
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.
-
[tests] Comment for why logging config is set as command-line args. 7b29ec277b
-
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.
-
jamesob commented at 5:57 PM on May 3, 2019: member
-
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?
-
MarcoFalke commented at 1:22 PM on May 6, 2019: member
@jonatack Good catch. I suggest to extend some
assert_debug_logwith a string that also matches the thread name. Maybe in script checking or net? -
jnewbery commented at 4:48 PM on May 6, 2019: member
Note that
logthreadnamesdoes 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 implementationAfter:
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 -
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.
- MarcoFalke merged this on May 6, 2019
- MarcoFalke closed this on May 6, 2019
- MarcoFalke referenced this in commit 8ec7121a45 on May 6, 2019
- jnewbery deleted the branch on May 6, 2019
- sidhujag referenced this in commit a31e3a44c8 on May 10, 2019
- deadalnix referenced this in commit 05960024a5 on Jul 30, 2020
- kittywhiskers referenced this in commit 5219112dee on Nov 3, 2021
- kittywhiskers referenced this in commit 147b0a753b on Nov 4, 2021
- kittywhiskers referenced this in commit f9d5542daa on Nov 11, 2021
- pravblockc referenced this in commit 8bedc30432 on Nov 18, 2021
- MarcoFalke locked this on Dec 16, 2021