Test case for #7316
Test code: $ git checkout fadceb7;make;BITCOIND=bitcoin-qt qa/pull-tester/rpc-tests.py keypool
...
Running testscript keypool.py ...
Initializing test directory /tmp/testqf3QO4
Assertion failed: 1452255264 != 0
Test case for #7316
Test code: $ git checkout fadceb7;make;BITCOIND=bitcoin-qt qa/pull-tester/rpc-tests.py keypool
...
Running testscript keypool.py ...
Initializing test directory /tmp/testqf3QO4
Assertion failed: 1452255264 != 0
Nice! utACK.
But this actually does not test the issue #7316, because the reported issue can only happen when you run bitcoin-qt with -server=1.
@jonasschnelli See my "test code" ;)
Are you still working on the BITCOIND=bitcoin-qt nightly rpc tests?
@MarcoFalke: Ah. Right. Your testcode looks good. Indeed, this would catch #7316.
Are you still working on the BITCOIND=bitcoin-qt nightly rpc tests?
It's relatively far down on my priority list. But not given up...
69 | @@ -70,9 +70,11 @@ def run_test(self): 70 | assert(e.error['code']==-12) 71 | 72 | # refill keypool with three new addresses 73 | - nodes[0].walletpassphrase('test', 12000) 74 | + nodes[0].walletpassphrase('test', 1) 75 | nodes[0].keypoolrefill(3) 76 | - nodes[0].walletlock() 77 | + # test walletpassphrase timeout 78 | + time.sleep(1)
Concept ACK, but setting a timeout of 1 and then waiting a second is too close. A slight mistiming (e.g. busy machine) would result in a race condition, what about waiting 2 seconds instead?
74 | + nodes[0].walletpassphrase('test', 1) 75 | nodes[0].keypoolrefill(3) 76 | - nodes[0].walletlock() 77 | + # test walletpassphrase timeout 78 | + time.sleep(1.1) 79 | + assert_equal(nodes[0].getwalletinfo()["unlocked_until"], 0)
Maybe this ought to actually try to do something to test the wallet relocking?