test: Fix intermittent failure in wallet_encryption#19429
Merged
maflcko merged 1 commit intobitcoin:masterfrom Jul 14, 2020
Merged
test: Fix intermittent failure in wallet_encryption#19429maflcko merged 1 commit intobitcoin:masterfrom
maflcko merged 1 commit intobitcoin:masterfrom
Conversation
Member
Author
jonatack
reviewed
Jul 8, 2020
| 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 |
Member
There was a problem hiding this comment.
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.
Member
There was a problem hiding this comment.
There are several of both int(time.time()) and time.time() in the test. Standardize on one of the two?
Member
Author
There was a problem hiding this comment.
They rounding needs to be exactly the way it is, otherwise the test wouldn't pass
Member
Author
|
@achow101 Mind taking a look here? |
Member
|
ACK fabd33b |
sidhujag
pushed a commit
to syscoin/syscoin
that referenced
this pull request
Jul 16, 2020
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Iterating all crypted keys might take time.
E.g.
https://cirrus-ci.com/task/5322429885054976?command=ci#L4517