Skip to content
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

Merged

Conversation

@jnewbery
Copy link
Member

@jnewbery jnewbery commented Aug 24, 2018

combine_logs.py currently inserts additional newlines into multi-line
log messages, and doesn't color them properly. Fix both of those.

combine_logs.py currently inserts additional newlines into multi-line
log messages, and doesn't color them properly. Fix both of those.
@jnewbery jnewbery force-pushed the improve_multi_line_logs_in_combine_logs branch from 50452a3 to 995dd89 Aug 24, 2018
@fanquake fanquake added the Tests label Aug 24, 2018
@laanwj
Copy link
Member

@laanwj laanwj commented Aug 27, 2018

I've fixed this once as well in the past but never got to submitting a PR
Thanks!

utACK 995dd89

@laanwj
Copy link
Member

@laanwj laanwj commented Aug 27, 2018

Tried to test, but it doesn't work as expected:

output of test/functional/feature_rbf.py --nocleanup
then test/functional/combine_logs.py /tmp/testpdobtlfa

before:

 node0 
2018-04-25T09:45:43Z 

2018-04-25T09:45:43Z Bitcoin Core version v0.16.99.0-7192b8f (release build)

2018-04-25T09:45:43Z InitParameterInteraction: parameter interaction: -bind set -> setting -listen=1

2018-04-25T09:45:43Z InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1

2018-04-25T09:45:43Z Validating signatures for all blocks.

2018-04-25T09:45:43Z Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000000000000

2018-04-25T09:45:43Z Using the 'standard' SHA256 implementation

2018-04-25T09:45:43Z Default data directory /home/orion/.bitcoin

2018-04-25T09:45:43Z Using data directory /store/orion/projects/bitcoin/bitcoin/test/cache/node0/regtest

2018-04-25T09:45:43Z Using config file /store/orion/projects/bitcoin/bitcoin/test/cache/node0/bitcoin.conf

2018-04-25T09:45:43Z Using at most 125 automatic connections (1024 file descriptors available)

2018-04-25T09:45:44Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements

2018-04-25T09:45:44Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements

2018-04-25T09:45:44Z Using 6 threads for script verification

2018-04-25T09:45:44Z scheduler thread start

2018-04-25T09:45:44Z HTTP: creating work queue of depth 16

after:

 node0                                    2018-04-25T09:45:43Z  
                                   2018-04-25T09:45:43Z Bitcoin Core version v0.16.99.0-7192b8f (release build)
                                   2018-04-25T09:45:43Z InitParameterInteraction: parameter interaction: -bind set -> setting -listen=1
                                   2018-04-25T09:45:43Z InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
                                   2018-04-25T09:45:43Z Validating signatures for all blocks.
                                   2018-04-25T09:45:43Z Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000000000000
                                   2018-04-25T09:45:43Z Using the 'standard' SHA256 implementation
                                   2018-04-25T09:45:43Z Default data directory /home/orion/.bitcoin
                                   2018-04-25T09:45:43Z Using data directory /store/orion/projects/bitcoin/bitcoin/test/cache/node0/regtest
                                   2018-04-25T09:45:43Z Using config file /store/orion/projects/bitcoin/bitcoin/test/cache/node0/bitcoin.conf
                                   2018-04-25T09:45:43Z Using at most 125 automatic connections (1024 file descriptors available)
                                   2018-04-25T09:45:44Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements

both before and after don't really make sense, or am I doing something wrong?

@jnewbery
Copy link
Member Author

@jnewbery jnewbery commented Aug 27, 2018

@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.

@laanwj
Copy link
Member

@laanwj laanwj commented Aug 28, 2018

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
utACK 16e288a

@laanwj laanwj merged commit 16e288a into bitcoin:master Aug 28, 2018
2 checks passed
laanwj added a commit that referenced this issue Aug 28, 2018
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
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this issue Jun 24, 2020
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
ftrader added a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this issue Aug 17, 2020
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
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 27, 2021
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
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 28, 2021
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
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 29, 2021
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
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 29, 2021
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
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 29, 2021
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
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 29, 2021
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
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 29, 2021
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
Munkybooty added a commit to Munkybooty/dash that referenced this issue Jun 30, 2021
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
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jul 1, 2021
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
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants