-
Notifications
You must be signed in to change notification settings - Fork 38.7k
test: Fix intermittent failure in wallet_encryption #19429
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
Conversation
jonatack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
| expected_time = int(time.time()) + MAX_VALUE - 600 | ||
| self.nodes[0].walletpassphrase(passphrase2, MAX_VALUE - 600) | ||
| # give buffer for walletpassphrase, since it iterates over all crypted keys | ||
| expected_time_with_buffer = time.time() + MAX_VALUE - 600 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While touching this test, mind renaming MAX_VALUE to MAX_SLEEP_TIME (per src/wallet/rpcwallet.cpp:1884) and moving the definition up to the top of the file or using local variable naming, e.g. max_sleep_time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are several of both int(time.time()) and time.time() in the test. Standardize on one of the two?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They rounding needs to be exactly the way it is, otherwise the test wouldn't pass
|
@achow101 Mind taking a look here? |
|
ACK fabd33b |
fabd33b test: Fix intermittent failure in wallet_encryption (MarcoFalke) Pull request description: Iterating all crypted keys might take time. E.g. ``` node0 2020-07-01T14:41:19.227367Z [httpworker.0] ThreadRPCServer method=walletpassphrase user=__cookie__ node0 2020-07-01T14:41:24.377142Z [httpworker.0] queue run of timer lockwallet() in 100000000 seconds (using HTTP) ... test 2020-07-01T14:41:24.379000Z TestFramework (ERROR): Assertion failed Traceback (most recent call last): File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 117, in main self.run_test() File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/wallet_encryption.py", line 88, in run_test assert_greater_than(expected_time + 5, actual_time) # 5 second buffer File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/util.py", line 54, in assert_greater_than raise AssertionError("%s <= %s" % (str(thing1), str(thing2))) AssertionError: 1693614483 <= 1693614484 ``` https://cirrus-ci.com/task/5322429885054976?command=ci#L4517 ACKs for top commit: achow101: ACK fabd33b Tree-SHA512: 7a3ccdfc0cdc05fef1f942d3167d100ed63422eb54c05405c884ed91162b7bdb5ce54cb5a981b99a6df2e4af1ea834ccd7d5156531c8c14ea13e735becd6b377
Iterating all crypted keys might take time.
E.g.
https://cirrus-ci.com/task/5322429885054976?command=ci#L4517