New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Tests] Make combine_logs.py handle multi-line logs #14051
[Tests] Make combine_logs.py handle multi-line logs #14051
Conversation
combine_logs.py currently inserts additional newlines into multi-line log messages, and doesn't color them properly. Fix both of those.
50452a3
to
995dd89
Compare
I've fixed this once as well in the past but never got to submitting a PR
|
Tried to test, but it doesn't work as expected: output of before:
after:
both before and after don't really make sense, or am I doing something wrong? |
@laanwj - your logs aren't using microseconds, although that should be set here:
I wonder if you're using an ancient cache from before microseconds were being used. Can you delete the /test/cache directory and try again? I've added an extra commit that handles timestamps without microseconds. |
huh I also remember doing that before, have a very strong deja-vu here :) will re-test, thanks! edit: works for me, both before and after removing cache |
16e288a test padding non micro timestamps (John Newbery) 995dd89 [Tests] Make combine_logs.py handle multi-line logs (John Newbery) Pull request description: combine_logs.py currently inserts additional newlines into multi-line log messages, and doesn't color them properly. Fix both of those. Tree-SHA512: dbe2f3ecc7cfbc95ee4350e648d127538c79cb6555257d4aeec12fe3d159366742b68e90e620c8ed7219a44b973395c7e5929ba374fae115fbee25560db645f6
Summary: 16e288acdd61fa5fa5e39f3936fb50499f82c085 test padding non micro timestamps (John Newbery) 995dd89d884bda3fb5ca1885c5887d989cd2cad3 [Tests] Make combine_logs.py handle multi-line logs (John Newbery) Pull request description: combine_logs.py currently inserts additional newlines into multi-line log messages, and doesn't color them properly. Fix both of those. Tree-SHA512: dbe2f3ecc7cfbc95ee4350e648d127538c79cb6555257d4aeec12fe3d159366742b68e90e620c8ed7219a44b973395c7e5929ba374fae115fbee25560db645f6 Backport of Core [[bitcoin/bitcoin#14051 | PR14051]] Test Plan: ``` test_runner.py --nocleanup rpc_rawtransaction ../test/functional/combine_logs.py ./test/tmp/test_runner.../rpc_rawtransaction.../ > log-X ``` Run the above both pre- and post-patch such that `log-X` is `prepatch` or `postpatch` Compare `log-prepatch` and `log-postpatch`. Notice differences such as: Pre-patch: ``` node0 2020-06-22T17:16:52.793492Z [default wallet] CommitTransaction: CTransaction(txid=3ba5b944de, ver=2, vin.size=1, vout.size=2, nLockTime=102) CTxIn(COutPoint(14a7dbe849, 0), scriptSig=47304402205c13e050921aed, nSequence=4294967294) CTxOut(nValue=48.49999775, scriptPubKey=76a914cccfd89d94937ba12e3e5cd4) CTxOut(nValue=1.50000000, scriptPubKey=76a914385b721de9b99a792a500d8e) ``` Post-patch: ``` node0 2020-06-22T17:12:12.764276Z [default wallet] CommitTransaction: CTransaction(txid=d3b2f85905, ver=2, vin.size=1, vout.size=2, nLockTime=102) CTxIn(COutPoint(14a7dbe849, 0), scriptSig=47304402204a4cb54c886406, nSequence=4294967294) CTxOut(nValue=1.50000000, scriptPubKey=76a9148511074f89af479afce5ebbd) CTxOut(nValue=48.49999775, scriptPubKey=76a91440dd8375bebaa6eb331f6450) ``` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D6669
Summary: 16e288acdd61fa5fa5e39f3936fb50499f82c085 test padding non micro timestamps (John Newbery) 995dd89d884bda3fb5ca1885c5887d989cd2cad3 [Tests] Make combine_logs.py handle multi-line logs (John Newbery) Pull request description: combine_logs.py currently inserts additional newlines into multi-line log messages, and doesn't color them properly. Fix both of those. Tree-SHA512: dbe2f3ecc7cfbc95ee4350e648d127538c79cb6555257d4aeec12fe3d159366742b68e90e620c8ed7219a44b973395c7e5929ba374fae115fbee25560db645f6 Backport of Core [[bitcoin/bitcoin#14051 | PR14051]] Test Plan: ``` test_runner.py --nocleanup rpc_rawtransaction ../test/functional/combine_logs.py ./test/tmp/test_runner.../rpc_rawtransaction.../ > log-X ``` Run the above both pre- and post-patch such that `log-X` is `prepatch` or `postpatch` Compare `log-prepatch` and `log-postpatch`. Notice differences such as: Pre-patch: ``` node0 2020-06-22T17:16:52.793492Z [default wallet] CommitTransaction: CTransaction(txid=3ba5b944de, ver=2, vin.size=1, vout.size=2, nLockTime=102) CTxIn(COutPoint(14a7dbe849, 0), scriptSig=47304402205c13e050921aed, nSequence=4294967294) CTxOut(nValue=48.49999775, scriptPubKey=76a914cccfd89d94937ba12e3e5cd4) CTxOut(nValue=1.50000000, scriptPubKey=76a914385b721de9b99a792a500d8e) ``` Post-patch: ``` node0 2020-06-22T17:12:12.764276Z [default wallet] CommitTransaction: CTransaction(txid=d3b2f85905, ver=2, vin.size=1, vout.size=2, nLockTime=102) CTxIn(COutPoint(14a7dbe849, 0), scriptSig=47304402204a4cb54c886406, nSequence=4294967294) CTxOut(nValue=1.50000000, scriptPubKey=76a9148511074f89af479afce5ebbd) CTxOut(nValue=48.49999775, scriptPubKey=76a91440dd8375bebaa6eb331f6450) ``` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D6669
16e288a test padding non micro timestamps (John Newbery) 995dd89 [Tests] Make combine_logs.py handle multi-line logs (John Newbery) Pull request description: combine_logs.py currently inserts additional newlines into multi-line log messages, and doesn't color them properly. Fix both of those. Tree-SHA512: dbe2f3ecc7cfbc95ee4350e648d127538c79cb6555257d4aeec12fe3d159366742b68e90e620c8ed7219a44b973395c7e5929ba374fae115fbee25560db645f6
16e288a test padding non micro timestamps (John Newbery) 995dd89 [Tests] Make combine_logs.py handle multi-line logs (John Newbery) Pull request description: combine_logs.py currently inserts additional newlines into multi-line log messages, and doesn't color them properly. Fix both of those. Tree-SHA512: dbe2f3ecc7cfbc95ee4350e648d127538c79cb6555257d4aeec12fe3d159366742b68e90e620c8ed7219a44b973395c7e5929ba374fae115fbee25560db645f6
16e288a test padding non micro timestamps (John Newbery) 995dd89 [Tests] Make combine_logs.py handle multi-line logs (John Newbery) Pull request description: combine_logs.py currently inserts additional newlines into multi-line log messages, and doesn't color them properly. Fix both of those. Tree-SHA512: dbe2f3ecc7cfbc95ee4350e648d127538c79cb6555257d4aeec12fe3d159366742b68e90e620c8ed7219a44b973395c7e5929ba374fae115fbee25560db645f6
16e288a test padding non micro timestamps (John Newbery) 995dd89 [Tests] Make combine_logs.py handle multi-line logs (John Newbery) Pull request description: combine_logs.py currently inserts additional newlines into multi-line log messages, and doesn't color them properly. Fix both of those. Tree-SHA512: dbe2f3ecc7cfbc95ee4350e648d127538c79cb6555257d4aeec12fe3d159366742b68e90e620c8ed7219a44b973395c7e5929ba374fae115fbee25560db645f6
16e288a test padding non micro timestamps (John Newbery) 995dd89 [Tests] Make combine_logs.py handle multi-line logs (John Newbery) Pull request description: combine_logs.py currently inserts additional newlines into multi-line log messages, and doesn't color them properly. Fix both of those. Tree-SHA512: dbe2f3ecc7cfbc95ee4350e648d127538c79cb6555257d4aeec12fe3d159366742b68e90e620c8ed7219a44b973395c7e5929ba374fae115fbee25560db645f6
16e288a test padding non micro timestamps (John Newbery) 995dd89 [Tests] Make combine_logs.py handle multi-line logs (John Newbery) Pull request description: combine_logs.py currently inserts additional newlines into multi-line log messages, and doesn't color them properly. Fix both of those. Tree-SHA512: dbe2f3ecc7cfbc95ee4350e648d127538c79cb6555257d4aeec12fe3d159366742b68e90e620c8ed7219a44b973395c7e5929ba374fae115fbee25560db645f6
16e288a test padding non micro timestamps (John Newbery) 995dd89 [Tests] Make combine_logs.py handle multi-line logs (John Newbery) Pull request description: combine_logs.py currently inserts additional newlines into multi-line log messages, and doesn't color them properly. Fix both of those. Tree-SHA512: dbe2f3ecc7cfbc95ee4350e648d127538c79cb6555257d4aeec12fe3d159366742b68e90e620c8ed7219a44b973395c7e5929ba374fae115fbee25560db645f6
16e288a test padding non micro timestamps (John Newbery) 995dd89 [Tests] Make combine_logs.py handle multi-line logs (John Newbery) Pull request description: combine_logs.py currently inserts additional newlines into multi-line log messages, and doesn't color them properly. Fix both of those. Tree-SHA512: dbe2f3ecc7cfbc95ee4350e648d127538c79cb6555257d4aeec12fe3d159366742b68e90e620c8ed7219a44b973395c7e5929ba374fae115fbee25560db645f6
16e288a test padding non micro timestamps (John Newbery) 995dd89 [Tests] Make combine_logs.py handle multi-line logs (John Newbery) Pull request description: combine_logs.py currently inserts additional newlines into multi-line log messages, and doesn't color them properly. Fix both of those. Tree-SHA512: dbe2f3ecc7cfbc95ee4350e648d127538c79cb6555257d4aeec12fe3d159366742b68e90e620c8ed7219a44b973395c7e5929ba374fae115fbee25560db645f6
combine_logs.py currently inserts additional newlines into multi-line
log messages, and doesn't color them properly. Fix both of those.