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

test: Bump timeouts in feature_index_prune and wallet_importdescriptors #29791

Merged
merged 1 commit into from
Apr 7, 2024

Conversation

cbergqvist
Copy link
Contributor

@cbergqvist cbergqvist commented Apr 2, 2024

Timeout issues where encountered when running functional tests with --jobs=16 --extended.

Note that running --extended without --jobs=16 does not trigger the issues.

Tested under NixOS on a Xeon CPU with 16 logical cores.

(A few tests are skipped locally as I haven't enabled BPF and a few other things).

Measurements

Line in feature_index_prune.py took 101.6s, 96.6s, 103.0s across 3 runs on my machine.
Default limit is 60, suggested to increase limit to 150 seconds.

Line in the wallet_importdescriptors.py --descriptors took 5.4s, 5.7s, 6.0s across 3 runs.
Suggested to increase from 5 to 10 seconds.

Logs

Output slightly modified by separate change that lets code run past given timeouts and the provides more information - "Took 101.6 seconds to complete, 69.4% over the given limit.".

Click to expand.

feature_index_prune.py

52/305 - feature_index_prune.py failed, Duration: 250 s

stdout:
2024-04-01T22:25:24.010000Z TestFramework (INFO): PRNG seed is: 990421162716295219
2024-04-01T22:25:24.014000Z TestFramework (INFO): Initializing test directory /mnt/tmp/test_runner_₿_🏃_20240402_002516/feature_index_prune_302
2024-04-01T22:25:24.913000Z TestFramework (INFO): check if we can access blockfilters and coinstats when pruning is enabled but no blocks are actually pruned
2024-04-01T22:26:48.417000Z TestFramework (INFO): prune some blocks
2024-04-01T22:26:48.460000Z TestFramework (INFO): check if we can access the tips blockfilter and coinstats when we have pruned some blocks
2024-04-01T22:26:48.483000Z TestFramework (INFO): check if we can access the blockfilter and coinstats of a pruned block
2024-04-01T22:26:59.175000Z TestFramework (INFO): make sure trying to access the indices throws errors
2024-04-01T22:27:50.422000Z TestFramework (INFO): prune exactly up to the indices best blocks while the indices are disabled
2024-04-01T22:27:52.596000Z TestFramework (INFO): make sure that we can continue with the partially synced indices after having pruned up to the index height
2024-04-01T22:29:34.242000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: '''
        self.wait_until(lambda: self.nodes[1].getindexinfo() == expected_stats)#, timeout=150)
'''
2024-04-01T22:29:34.244000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/home/chris/Documents/Code/bitcoin-core/test/functional/test_framework/test_framework.py", line 132, in main
    self.run_test()
  File "/home/chris/Documents/Code/bitcoin-core/test/functional/feature_index_prune.py", line 117, in run_test
    self.sync_index(height=1500)
  File "/home/chris/Documents/Code/bitcoin-core/test/functional/feature_index_prune.py", line 34, in sync_index
    self.wait_until(lambda: self.nodes[1].getindexinfo() == expected_stats)#, timeout=150)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chris/Documents/Code/bitcoin-core/test/functional/test_framework/test_framework.py", line 780, in wait_until
    return wait_until_helper_internal(test_function, timeout=timeout, timeout_factor=self.options.timeout_factor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chris/Documents/Code/bitcoin-core/test/functional/test_framework/util.py", line 305, in wait_until_helper_internal
    raise AssertionError(m)
AssertionError: Predicate '''
        self.wait_until(lambda: self.nodes[1].getindexinfo() == expected_stats)#, timeout=150)
''' not true after 60 seconds. Took 101.6 seconds to complete, 69.4% over the given limit.
2024-04-01T22:29:34.298000Z TestFramework (INFO): Stopping nodes
2024-04-01T22:29:34.511000Z TestFramework (WARNING): Not cleaning up dir /mnt/tmp/test_runner_₿_🏃_20240402_002516/feature_index_prune_302
2024-04-01T22:29:34.511000Z TestFramework (ERROR): Test failed. Test logging available at /mnt/tmp/test_runner_₿_🏃_20240402_002516/feature_index_prune_302/test_framework.log
2024-04-01T22:29:34.511000Z TestFramework (ERROR): 
2024-04-01T22:29:34.512000Z TestFramework (ERROR): Hint: Call /home/chris/Documents/Code/bitcoin-core/test/functional/combine_logs.py '/mnt/tmp/test_runner_₿_🏃_20240402_002516/feature_index_prune_302' to consolidate all logs
2024-04-01T22:29:34.512000Z TestFramework (ERROR): 
2024-04-01T22:29:34.512000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2024-04-01T22:29:34.512000Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
2024-04-01T22:29:34.512000Z TestFramework (ERROR): 


stderr:


53/305 - p2p_blockfilters.py passed, Duration: 130 s

wallet_importdescriptors.py --descriptors

297/305 - wallet_importdescriptors.py --descriptors failed, Duration: 76 s

stdout:
2024-04-01T22:48:27.663000Z TestFramework (INFO): PRNG seed is: 8528678505617325332
2024-04-01T22:48:27.664000Z TestFramework (INFO): Initializing test directory /mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98
2024-04-01T22:48:28.021000Z TestFramework (INFO): Setting up wallets
2024-04-01T22:48:28.100000Z TestFramework (INFO): Mining coins
2024-04-01T22:48:29.714000Z TestFramework (INFO): Import should fail if a descriptor is not provided
2024-04-01T22:48:29.725000Z TestFramework (INFO): Should import a p2pkh descriptor
2024-04-01T22:48:29.740000Z TestFramework (INFO): Test can import same descriptor with public key twice
2024-04-01T22:48:29.760000Z TestFramework (INFO): Test can update descriptor label
2024-04-01T22:48:29.785000Z TestFramework (INFO): Internal addresses cannot have labels
2024-04-01T22:48:29.788000Z TestFramework (INFO): Internal addresses should be detected as such
2024-04-01T22:48:29.854000Z TestFramework (INFO): Should not import a p2sh-p2wpkh descriptor without checksum
2024-04-01T22:48:29.855000Z TestFramework (INFO): Should not import a p2sh-p2wpkh descriptor that has range specified
2024-04-01T22:48:29.858000Z TestFramework (INFO): Should not import a p2sh-p2wpkh descriptor and have it set to active
2024-04-01T22:48:29.860000Z TestFramework (INFO): Should import a (non-active) p2sh-p2wpkh descriptor
2024-04-01T22:48:29.984000Z TestFramework (INFO): Should import a 1-of-2 bare multisig from descriptor
2024-04-01T22:48:30.002000Z TestFramework (INFO): Should not treat individual keys from the imported bare multisig as watchonly
2024-04-01T22:48:30.005000Z TestFramework (INFO): Ranged descriptors cannot have labels
2024-04-01T22:48:30.014000Z TestFramework (INFO): Private keys required for private keys enabled wallet
2024-04-01T22:48:30.027000Z TestFramework (INFO): Ranged descriptor import should warn without a specified range
2024-04-01T22:48:30.065000Z TestFramework (INFO): Should not import a ranged descriptor that includes xpriv into a watch-only wallet
2024-04-01T22:48:30.070000Z TestFramework (INFO): Should not import a descriptor with hardened derivations when private keys are disabled
2024-04-01T22:48:30.108000Z TestFramework (INFO): Verify we can only extend descriptor's range
2024-04-01T22:48:30.364000Z TestFramework (INFO): Check we can change descriptor internal flag
2024-04-01T22:48:30.536000Z TestFramework (INFO): Key ranges should be imported in order
2024-04-01T22:48:30.708000Z TestFramework (INFO): Check we can change next_index
2024-04-01T22:48:30.838000Z TestFramework (INFO): Check imported descriptors are not active by default
2024-04-01T22:48:30.870000Z TestFramework (INFO): Check can activate inactive descriptor
2024-04-01T22:48:30.903000Z TestFramework (INFO): Check can deactivate active descriptor
2024-04-01T22:48:30.924000Z TestFramework (INFO): Verify activation state is persistent
2024-04-01T22:48:30.973000Z TestFramework (INFO): Should import a descriptor with a WIF private key as spendable
2024-04-01T22:48:30.987000Z TestFramework (INFO): Test can import same descriptor with private key twice
2024-04-01T22:48:32.173000Z TestFramework (INFO): Test that multisigs can be imported, signed for, and getnewaddress'd
2024-04-01T22:48:43.803000Z TestFramework (INFO): Multisig with distributed keys
2024-04-01T22:48:48.895000Z TestFramework (INFO): We can create and use a huge multisig under P2WSH
2024-04-01T22:49:05.628000Z TestFramework (INFO): Under P2SH, multisig are standard with up to 15 compressed keys
2024-04-01T22:49:20.258000Z TestFramework (INFO): Amending multisig with new private keys
2024-04-01T22:49:23.306000Z TestFramework (INFO): Combo descriptors cannot be active
2024-04-01T22:49:23.313000Z TestFramework (INFO): Descriptors with no type cannot be active
2024-04-01T22:49:23.348000Z TestFramework (INFO): Test importing a descriptor to an encrypted wallet
2024-04-01T22:49:43.957000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/home/chris/Documents/Code/bitcoin-core/test/functional/test_framework/test_framework.py", line 132, in main
    self.run_test()
  File "/home/chris/Documents/Code/bitcoin-core/test/functional/wallet_importdescriptors.py", line 691, in run_test
    with self.nodes[0].assert_debug_log(expected_msgs=["Rescan started from block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206... (slow variant inspecting all blocks)"], timeout=5):#10):
  File "/nix/store/rac8pxbi1vapwrlqzbrkycbyg521djzw-python3-3.11.6/lib/python3.11/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/home/chris/Documents/Code/bitcoin-core/test/functional/test_framework/test_node.py", line 493, in assert_debug_log
    self._raise_assertion_error(f'Expected messages "{expected_msgs}" found too late, took {now - start:.1f} seconds, {((now - start) / (time_end - start)) - 1:.1%} over the given limit. Log:\n\n{print_log}\n\n')
  File "/home/chris/Documents/Code/bitcoin-core/test/functional/test_framework/test_node.py", line 188, in _raise_assertion_error
    raise AssertionError(self._node_msg(msg))
AssertionError: [node 0] Expected messages "['Rescan started from block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206... (slow variant inspecting all blocks)']" found too late, took 5.4 seconds, 8.9% over the given limit. Log:

 - 2024-04-01T22:49:33.066512Z [http] [httpserver.cpp:306] [http_request_cb] [http] Received a POST request for /wallet/encrypted_wallet from 127.0.0.1:47658
 - 2024-04-01T22:49:33.066668Z [httpworker.0] [rpc/request.cpp:187] [parse] [rpc] ThreadRPCServer method=importdescriptors user=__cookie__
 - 2024-04-01T22:49:33.070999Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT INTO main VALUES(?, ?)
 - 2024-04-01T22:49:33.071061Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: DELETE FROM main WHERE key = ?
 - 2024-04-01T22:49:33.071137Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: BEGIN TRANSACTION
 - 2024-04-01T22:49:33.074190Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?)
 - 2024-04-01T22:49:33.075564Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?)
...<thousands of almost identical lines>...
 - 2024-04-01T22:49:38.416139Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?)
 - 2024-04-01T22:49:38.416528Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?)
 - 2024-04-01T22:49:38.427946Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: COMMIT TRANSACTION
 - 2024-04-01T22:49:38.429778Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?)
 - 2024-04-01T22:49:38.429916Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?)
 - 2024-04-01T22:49:38.430001Z [httpworker.0] [wallet/wallet.h:933] [WalletLogPrintf] [encrypted_wallet] Setting spkMan to active: id = c6149b35399517457b0b1d8ccdd7efda25a2f20fc7f8167adda8e79b10e260b7, type = legacy, internal = false
 - 2024-04-01T22:49:38.430134Z [httpworker.0] [wallet/wallet.h:933] [WalletLogPrintf] [encrypted_wallet] RescanFromTime: Rescanning last 329 blocks
 - 2024-04-01T22:49:38.430170Z [httpworker.0] [wallet/wallet.h:933] [WalletLogPrintf] [encrypted_wallet] Rescan started from block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206... (slow variant inspecting all blocks)
 - 2024-04-01T22:49:38.441914Z [httpworker.0] [wallet/scriptpubkeyman.h:258] [WalletLogPrintf] [encrypted_wallet] MarkUnusedAddresses: Detected a used keypool item at index 4000, mark all keypool items up to this item as used


2024-04-01T22:49:44.029000Z TestFramework (INFO): Stopping nodes
2024-04-01T22:49:44.132000Z TestFramework (WARNING): Not cleaning up dir /mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98
2024-04-01T22:49:44.132000Z TestFramework (ERROR): Test failed. Test logging available at /mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/test_framework.log
2024-04-01T22:49:44.132000Z TestFramework (ERROR): 
2024-04-01T22:49:44.133000Z TestFramework (ERROR): Hint: Call /home/chris/Documents/Code/bitcoin-core/test/functional/combine_logs.py '/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98' to consolidate all logs
2024-04-01T22:49:44.133000Z TestFramework (ERROR): 
2024-04-01T22:49:44.133000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2024-04-01T22:49:44.133000Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
2024-04-01T22:49:44.133000Z TestFramework (ERROR): 


stderr:


Remaining jobs: [feature_pruning.py, feature_dbcrash.py, feature_assumeutxo.py, rpc_scantxoutset.py, feature_coinstatsindex.py, p2p_node_network_limited.py --v1transport, p2p_node_network_limited.py --v2transport, feature_config_args.py]
298/305 - p2p_node_network_limited.py --v1transport passed, Duration: 24 s

Related

Almost identical timeout in feature_index_prune.py in #27091 on MacOS, and for wallet_importdescriptors.py --descriptors in #27282 on Alpine & CI.

Timeout issues where encountered when running functional tests with `--jobs=16 --extended`.

Line in `feature_index_prune.py` took 101.6s, 96.6s, 103.0s across 3 runs on my machine, default limit is 60.

Line in the `wallet_importdescriptors.py --descriptors` took 5.4s, 5.7s, 6.0s across 3 runs.
@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 2, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK maflcko, tdb3, BrandonOdiwuor, itornaza

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@cbergqvist
Copy link
Contributor Author

@maflcko
Copy link
Member

maflcko commented Apr 3, 2024

lgtm ACK 49c0b8b

Copy link
Contributor

@tdb3 tdb3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @cbergqvist. The code changes lgtm.

It may be worth investigating why these tests are taking longer to run, and if that is expected or a potential performance regression that went unnoticed until now. I'm assuming that the tests were passing at some point with the existing timeout values (and that those values were chosen for a reason).

I don't have all the history on this, so I could be missing something. Perhaps it's dependent on how the tests are run (e.g. --jobs chosen), and if that's the case, this PR addresses that.

Might be worth running git blame to find the previous PR that is associated with the previous timeouts to see if there is rationale (a stretch, but worth a quick check).

@cbergqvist
Copy link
Contributor Author

Thanks for having a look @tdb3!

As mentioned in the summary, running without --jobs=16 makes the tests succeed. I guess it is not a common parameter (even less common in conjunction with --extended).

Your questions prompted me to perform the tests on older release branches to see if behavior changed recently. (No other tests failed but I didn't let feature_dbcrash.py and complete since it takes around 45 minutes (occasionally skipped some other stragglers as well)).

27.x - Only feature_index_prune.py failed (4 runs), both failed (2 runs).

26.x - Only feature_index_prune.py failed - wallet_importdescriptors.py --descriptors succeeded (4 runs)

25.x - Only feature_index_prune.py failed - wallet_importdescriptors.py --descriptors succeeded (1 runs)

The fact that these two tests fail so consistently while no other tests fail helped increase my confidence in this change. The major reason wallet_importdescriptors.py is not failing as often probably lies in the difference in how much the timeouts are exceeded.

Might be worth running git blame to find the previous PR that is associated with the previous timeouts to see if there is rationale (a stretch, but worth a quick check).

Agree that it might be fruitful to investigate the history of wallet_importdescriptors.py to pinpoint regressions, didn't have time today.

@cbergqvist
Copy link
Contributor Author

@itornaza subtly prompted me to do some tests to find the sweet spot for the number of jobs on my hardware, which luckily helps motivate why running with 16 jobs is not unreasonable.

This is wall time running on a RAM disk without --extended.

jobs duration (s) results
4    816          all passed
8    454          all passed
12   342          all passed
16   300          all passed
20   279          all passed
24   264          all passed
26   256          all passed
28   261          all passed
30   260          all passed

(These happened to be run on 26.x branch, running the same on this PR (49c0b8b) with 16 jobs got me 327 seconds, so things haven't moved too much).

@tdb3
Copy link
Contributor

tdb3 commented Apr 4, 2024

As mentioned in the summary, running without --jobs=16 makes the tests succeed

Ok, this gives me a bit more confidence that this may just be a simple case of resource contention from high concurrency slowing things down. Omitting --jobs causes the default value of 4 jobs to be used. In general, IIRC jobs != threads of execution (since some tests run multiple nodes, etc.). I was also able to reproduce the failure of feature_index_prune.py with --jobs=18 (on master).

Your questions prompted me to perform the tests on older release branches to see if behavior changed recently. (No other tests failed but I didn't let feature_dbcrash.py and complete since it takes around 45 minutes (occasionally skipped some other stragglers as well)).

27.x - Only feature_index_prune.py failed (4 runs), both failed (2 runs).

26.x - Only feature_index_prune.py failed - wallet_importdescriptors.py --descriptors succeeded (4 runs)

25.x - Only feature_index_prune.py failed - wallet_importdescriptors.py --descriptors succeeded (1 runs)

The fact that these two tests fail so consistently while no other tests fail helped increase my confidence in this change.

Good work gathering data.

Since these tests only seem to be failing with high levels of concurrency, I'm ok with an ACK. I don't have the time currently to further performance profile this, but maybe someone else does.

ACK for 49c0b8b

@DrahtBot DrahtBot removed the CI failed label Apr 5, 2024
Copy link
Contributor

@BrandonOdiwuor BrandonOdiwuor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crACK 49c0b8b

@itornaza
Copy link
Contributor

itornaza commented Apr 5, 2024

approach ACK 49c0b8b

It is indeed frustrating to watch some functional tests failing by just using 12-16 jobs in parallel. This PR addresses the issue with minimal footprint in the test code. However, the timeout of some tests are even greater on my machine without me understanding the reason yet. Until this issue is resolved, running the extended tests with the default number of jobs seems the best approach to me.

On Master branch

Replicated the errant behavior with the --extended flag on the master branch for 12, 13 and 16 jobs with the following functional tests failing:

wallet_importdescriptors.py --descriptors              | ✖ Failed  | 106 s (timeout > 60 s)

and another one not covered in this PR:

wallet_transactiontime_rescan.py --legacy-wallet       | ✖ Failed  | 150 s (not covered by this PR)

Tests on PR Branch

  • Run all functional tests with --extended and the default 4 jobs and all tests pass
  • Run all functional tests with --extended and --jobs=13 and all pass except:
wallet_transactiontime_rescan.py --legacy-wallet       | ✖ Failed  | 146 s (not covered by this PR)

which is a test not in the scope of this PR anyway.

  • Run all functional tests with --extended and --jobs=16 multiple times and after cleaning the test environment in order to be on the safe side, and all tests pass except:
feature_index_prune.py                                 | ✖ Failed  | 183 s (timeout > 150 s)
wallet_importdescriptors.py --descriptors              | ✖ Failed  | 122 s (timeout > 10 s)

and again the same test that is not a subject of this PR:

wallet_transactiontime_rescan.py --legacy-wallet       | ✖ Failed  | 159 s (not covered by this PR)

Note: All test run on Apple M2 Max chip and macos 14.4.1 (23E224)

@cbergqvist
Copy link
Contributor Author

cbergqvist commented Apr 5, 2024

Thanks for trying it out!

and again the same test that is not a subject of this PR:

wallet_transactiontime_rescan.py --legacy-wallet       | ✖ Failed  | 159 s (not covered by this PR)

Note: All test run on Apple M2 Max chip and macos 14.4.1 (23E224)

Searched closed issues and it seems like others running on Mac are also seeing wallet_transactiontime_rescan.py --legacy-wallet fail: #28221. Hopefully that specific failure & fix can be addressed in that issue.

Edit:

feature_index_prune.py                                 | ✖ Failed  | 183 s (timeout > 150 s)
wallet_importdescriptors.py --descriptors              | ✖ Failed  | 122 s (timeout > 10 s)

Wait.. the modified tests still fail with the commit in this PR. Hm.. good find! I could understand maybe bumping the first one from 60 s all the way to 200 s (233% increase). But bumping the second one from 10 s to 150 s is more than 10x. :\

@cbergqvist
Copy link
Contributor Author

@itornaza if you have the inclination, it might be helpful if you could provide combined logs for the wallet_importdescriptors.py --descriptors test when it fails even when using this PR's commit. Then I/we could compare it with the combined logs produced on my machine (uploaded and linked in the first comment) and maybe figure out what lies behind the performance difference.

@itornaza
Copy link
Contributor

itornaza commented Apr 6, 2024

@cbergqvist I re-run today the test/functional/test_runner.py --jobs=16 --extended two times on the PR branch after cleaning up everything and building the branch again. I include the log files for each of the errors. I will happily assist you since my current goal is to build up confidence in running the test harness!

First run

wallet_importdescriptors.py --descriptors              | ✖ Failed  | 139 s 
wallet_transactiontime_rescan.py --legacy-wallet       | ✖ Failed  | 161 s
wallet_importdescriptors log
2024-04-06T10:09:11.791000Z TestFramework (INFO): PRNG seed is: 311790312446680818
2024-04-06T10:09:11.802000Z TestFramework (DEBUG): Setting up network thread
2024-04-06T10:09:11.806000Z TestFramework (INFO): Initializing test directory /var/folders/qy/mc4396sn0ql8dpl5q852sng40000gn/T/test_runner_₿_🏃_20240406_130246/wallet_importdescriptors_98
2024-04-06T10:09:11.897000Z TestFramework.node0 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-06T10:09:11.911000Z TestFramework.node1 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-06T10:09:12.981000Z TestFramework.node0 (DEBUG): RPC successfully started
2024-04-06T10:09:13.007000Z TestFramework.node1 (DEBUG): RPC successfully started
2024-04-06T10:09:13.244000Z TestFramework (INFO): Setting up wallets
2024-04-06T10:09:14.489000Z TestFramework (INFO): Mining coins
2024-04-06T10:09:24.007000Z TestFramework (INFO): Import should fail if a descriptor is not provided
2024-04-06T10:09:24.029000Z TestFramework (INFO): Should import a p2pkh descriptor
2024-04-06T10:09:24.158000Z TestFramework (INFO): Test can import same descriptor with public key twice
2024-04-06T10:09:24.250000Z TestFramework (INFO): Test can update descriptor label
2024-04-06T10:09:24.326000Z TestFramework (INFO): Internal addresses cannot have labels
2024-04-06T10:09:24.346000Z TestFramework (INFO): Internal addresses should be detected as such
2024-04-06T10:09:24.423000Z TestFramework (INFO): Should not import a p2sh-p2wpkh descriptor without checksum
2024-04-06T10:09:24.439000Z TestFramework (INFO): Should not import a p2sh-p2wpkh descriptor that has range specified
2024-04-06T10:09:24.463000Z TestFramework (INFO): Should not import a p2sh-p2wpkh descriptor and have it set to active
2024-04-06T10:09:24.487000Z TestFramework (INFO): Should import a (non-active) p2sh-p2wpkh descriptor
2024-04-06T10:09:24.957000Z TestFramework (INFO): Should import a 1-of-2 bare multisig from descriptor
2024-04-06T10:09:25.024000Z TestFramework (INFO): Should not treat individual keys from the imported bare multisig as watchonly
2024-04-06T10:09:25.050000Z TestFramework (INFO): Ranged descriptors cannot have labels
2024-04-06T10:09:25.067000Z TestFramework (INFO): Private keys required for private keys enabled wallet
2024-04-06T10:09:25.078000Z TestFramework (INFO): Ranged descriptor import should warn without a specified range
2024-04-06T10:09:25.115000Z TestFramework (INFO): Should not import a ranged descriptor that includes xpriv into a watch-only wallet
2024-04-06T10:09:25.124000Z TestFramework (INFO): Should not import a descriptor with hardened derivations when private keys are disabled
2024-04-06T10:09:25.197000Z TestFramework (INFO): Verify we can only extend descriptor's range
2024-04-06T10:09:25.619000Z TestFramework (INFO): Check we can change descriptor internal flag
2024-04-06T10:09:25.846000Z TestFramework (INFO): Key ranges should be imported in order
2024-04-06T10:09:26.635000Z TestFramework (INFO): Check we can change next_index
2024-04-06T10:09:27.244000Z TestFramework (INFO): Check imported descriptors are not active by default
2024-04-06T10:09:27.334000Z TestFramework (INFO): Check can activate inactive descriptor
2024-04-06T10:09:27.435000Z TestFramework (INFO): Check can deactivate active descriptor
2024-04-06T10:09:27.568000Z TestFramework (INFO): Verify activation state is persistent
2024-04-06T10:09:27.980000Z TestFramework (INFO): Should import a descriptor with a WIF private key as spendable
2024-04-06T10:09:28.053000Z TestFramework (INFO): Test can import same descriptor with private key twice
2024-04-06T10:09:28.935000Z TestFramework (INFO): Test that multisigs can be imported, signed for, and getnewaddress'd
2024-04-06T10:09:29.665000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-06T10:09:32.954000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-06T10:09:34.163000Z TestFramework (INFO): Multisig with distributed keys
2024-04-06T10:09:34.612000Z TestFramework (INFO): We can create and use a huge multisig under P2WSH
2024-04-06T10:09:35.489000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-06T10:09:35.501000Z TestFramework (INFO): Under P2SH, multisig are standard with up to 15 compressed keys
2024-04-06T10:09:36.347000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-06T10:09:37.714000Z TestFramework (INFO): Amending multisig with new private keys
2024-04-06T10:09:38.065000Z TestFramework (INFO): Combo descriptors cannot be active
2024-04-06T10:09:38.065000Z TestFramework (INFO): Descriptors with no type cannot be active
2024-04-06T10:09:38.079000Z TestFramework (INFO): Test importing a descriptor to an encrypted wallet
2024-04-06T10:10:30.316000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_framework.py", line 132, in main
    self.run_test()
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/wallet_importdescriptors.py", line 692, in run_test
    importing = thread.submit(encrypted_wallet.importdescriptors, requests=[descriptor])
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/contextlib.py", line 124, in __exit__
    next(self.gen)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_node.py", line 490, in assert_debug_log
    self._raise_assertion_error('Expected messages "{}" does not partially match log:\n\n{}\n\n'.format(str(expected_msgs), print_log))
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_node.py", line 188, in _raise_assertion_error
    raise AssertionError(self._node_msg(msg))
AssertionError: [node 0] Expected messages "['Rescan started from block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206... (slow variant inspecting all blocks)']" does not partially match log:

 - 2024-04-06T10:10:00.315333Z [http] [httpserver.cpp:306] [http_request_cb] [http] Received a POST request for /wallet/encrypted_wallet from 127.0.0.1:63874
 - 2024-04-06T10:10:00.320140Z [httpworker.0] [rpc/request.cpp:187] [parse] [rpc] ThreadRPCServer method=importdescriptors user=__cookie__
 
 ...
 
 - 2024-04-06T10:10:10.303007Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/var/folders/qy/mc4396sn0ql8dpl5q852sng40000gn/T/test_runner_₿_🏃_20240406_130246/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?)
 - 2024-04-06T10:10:10.306904Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/var/folders/qy/mc4396sn0ql8dpl5q852sng40000gn/T/test_runner_₿_🏃_20240406_130246/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?)


2024-04-06T10:10:30.324000Z TestFramework (DEBUG): Closing down network thread
2024-04-06T10:10:30.380000Z TestFramework (INFO): Stopping nodes
2024-04-06T10:10:30.389000Z TestFramework.node0 (DEBUG): Stopping node
2024-04-06T10:10:30.390000Z TestFramework.node0 (ERROR): Unable to stop node.
Traceback (most recent call last):
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_node.py", line 375, in stop_node
    self.stop(wait=wait)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/coverage.py", line 50, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 127, in __call__
    response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 105, in _request
    self.__conn.request(method, path, postdata, headers)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1257, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1268, in _send_request
    self.putrequest(method, url, **skips)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1094, in putrequest
    raise CannotSendRequest(self.__state)
http.client.CannotSendRequest: Request-sent
2024-04-06T10:10:30.395000Z TestFramework.node1 (DEBUG): Stopping node
2024-04-06T10:11:30.443000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        self.wait_until(lambda: self.is_node_stopped(expected_ret_code=expected_ret_code, **kwargs), timeout=timeout)
'''

wallet_transactiontime_rescan log
2024-04-06T10:07:52.362000Z TestFramework (INFO): PRNG seed is: 5681009932255616667
2024-04-06T10:07:52.367000Z TestFramework (DEBUG): Setting up network thread
2024-04-06T10:07:52.367000Z TestFramework (INFO): Initializing test directory /var/folders/qy/mc4396sn0ql8dpl5q852sng40000gn/T/test_runner_₿_🏃_20240406_130246/wallet_transactiontime_rescan_173
2024-04-06T10:07:52.368000Z TestFramework (DEBUG): Copy cache directory /Users/ioannis/Documents/projects/bitcoin/bitcoin/test/cache/node0 to node 0
2024-04-06T10:07:52.427000Z TestFramework (DEBUG): Copy cache directory /Users/ioannis/Documents/projects/bitcoin/bitcoin/test/cache/node0 to node 1
2024-04-06T10:07:52.511000Z TestFramework (DEBUG): Copy cache directory /Users/ioannis/Documents/projects/bitcoin/bitcoin/test/cache/node0 to node 2
2024-04-06T10:07:52.760000Z TestFramework.node0 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-06T10:07:52.774000Z TestFramework.node1 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-06T10:07:52.783000Z TestFramework.node2 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-06T10:07:53.599000Z TestFramework.node0 (DEBUG): RPC successfully started
2024-04-06T10:07:53.629000Z TestFramework.node1 (DEBUG): RPC successfully started
2024-04-06T10:07:53.662000Z TestFramework.node2 (DEBUG): RPC successfully started
2024-04-06T10:07:56.822000Z TestFramework (DEBUG): Generate a block with current time
2024-04-06T10:07:56.826000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-06T10:07:57.259000Z TestFramework (INFO): Prepare nodes and wallet
2024-04-06T10:07:59.483000Z TestFramework (INFO): Start transactions
2024-04-06T10:08:03.676000Z TestFramework (INFO): Send 10 btc to user
2024-04-06T10:08:05.553000Z TestFramework (INFO): Send 5 btc to user
2024-04-06T10:08:07.670000Z TestFramework (INFO): Send 1 btc to user
2024-04-06T10:08:11.447000Z TestFramework (INFO): Check user's final balance and transaction count
2024-04-06T10:08:11.457000Z TestFramework (INFO): Check transaction times
2024-04-06T10:08:11.475000Z TestFramework (INFO): Restore user wallet on another node without rescan
2024-04-06T10:08:11.947000Z TestFramework (INFO): Rescan last history part
2024-04-06T10:08:12.007000Z TestFramework (INFO): Rescan all history
2024-04-06T10:08:12.083000Z TestFramework (INFO): Check user's final balance and transaction count after restoration
2024-04-06T10:08:12.097000Z TestFramework (INFO): Check transaction times after restoration
2024-04-06T10:08:12.124000Z TestFramework (INFO): Test handling of invalid parameters for rescanblockchain
2024-04-06T10:08:12.128000Z TestFramework (INFO): Test `rescanblockchain` fails when wallet is encrypted and locked
2024-04-06T10:08:13.302000Z TestFramework (INFO): Test rescanning an encrypted wallet
2024-04-06T10:08:47.620000Z TestFramework.bitcoincli (DEBUG): Running bitcoin-cli ['-rpcwallet=encrypted_wallet', 'walletpassphrase', 'passphrase', '1']
2024-04-06T10:09:33.005000Z TestFramework.bitcoincli (DEBUG): Running bitcoin-cli ['-rpcwallet=encrypted_wallet', 'walletlock']
2024-04-06T10:09:33.010000Z TestFramework.bitcoincli (DEBUG): Running bitcoin-cli ['-rpcwallet=encrypted_wallet', 'walletpassphrasechange', 'passphrase', 'newpassphrase']
2024-04-06T10:09:33.021000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 151, in _get_response
    http_response = self.__conn.getresponse()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1349, in getresponse
    response.begin()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 316, in begin
    version, status, reason = self._read_status()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 277, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/socket.py", line 704, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_framework.py", line 132, in main
    self.run_test()
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/wallet_transactiontime_rescan.py", line 221, in run_test
    assert_equal(rescanning.result(), {"start_height": 0, "stop_height": 803})
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/concurrent/futures/_base.py", line 438, in result
    return self.__get_result()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result
    raise self._exception
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/coverage.py", line 50, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 127, in __call__
    response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 106, in _request
    return self._get_response()
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 153, in _get_response
    raise JSONRPCException({
test_framework.authproxy.JSONRPCException: 'rescanblockchain' RPC took longer than 30.000000 seconds. Consider using larger timeout for calls that take longer to return. (-344)
2024-04-06T10:09:33.029000Z TestFramework (DEBUG): Closing down network thread
2024-04-06T10:09:33.083000Z TestFramework (INFO): Stopping nodes
2024-04-06T10:09:33.084000Z TestFramework.node0 (DEBUG): Stopping node
2024-04-06T10:09:33.084000Z TestFramework.node0 (ERROR): Unable to stop node.
Traceback (most recent call last):
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_node.py", line 375, in stop_node
    self.stop(wait=wait)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/coverage.py", line 50, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 127, in __call__
    response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 105, in _request
    self.__conn.request(method, path, postdata, headers)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1257, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1268, in _send_request
    self.putrequest(method, url, **skips)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1094, in putrequest
    raise CannotSendRequest(self.__state)
http.client.CannotSendRequest: Request-sent
2024-04-06T10:09:33.087000Z TestFramework.node1 (DEBUG): Stopping node
2024-04-06T10:09:33.088000Z TestFramework.node2 (DEBUG): Stopping node
2024-04-06T10:10:33.103000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        self.wait_until(lambda: self.is_node_stopped(expected_ret_code=expected_ret_code, **kwargs), timeout=timeout)
'''

Second run

wallet_importdescriptors.py --descriptors              | ✖ Failed  | 138 s
wallet_transactiontime_rescan.py --legacy-wallet       | ✖ Failed  | 159 s
wallet_importdescriptors log
2024-04-06T12:24:20.204000Z TestFramework (INFO): PRNG seed is: 2127799964856154174
2024-04-06T12:24:20.208000Z TestFramework (DEBUG): Setting up network thread
2024-04-06T12:24:20.213000Z TestFramework (INFO): Initializing test directory /var/folders/qy/mc4396sn0ql8dpl5q852sng40000gn/T/test_runner_₿_🏃_20240406_151754/wallet_importdescriptors_98
2024-04-06T12:24:20.304000Z TestFramework.node0 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-06T12:24:20.315000Z TestFramework.node1 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-06T12:24:21.366000Z TestFramework.node0 (DEBUG): RPC successfully started
2024-04-06T12:24:21.385000Z TestFramework.node1 (DEBUG): RPC successfully started
2024-04-06T12:24:21.610000Z TestFramework (INFO): Setting up wallets
2024-04-06T12:24:22.615000Z TestFramework (INFO): Mining coins
2024-04-06T12:24:29.829000Z TestFramework (INFO): Import should fail if a descriptor is not provided
2024-04-06T12:24:29.856000Z TestFramework (INFO): Should import a p2pkh descriptor
2024-04-06T12:24:29.950000Z TestFramework (INFO): Test can import same descriptor with public key twice
2024-04-06T12:24:30.021000Z TestFramework (INFO): Test can update descriptor label
2024-04-06T12:24:30.107000Z TestFramework (INFO): Internal addresses cannot have labels
2024-04-06T12:24:30.142000Z TestFramework (INFO): Internal addresses should be detected as such
2024-04-06T12:24:30.228000Z TestFramework (INFO): Should not import a p2sh-p2wpkh descriptor without checksum
2024-04-06T12:24:30.252000Z TestFramework (INFO): Should not import a p2sh-p2wpkh descriptor that has range specified
2024-04-06T12:24:30.272000Z TestFramework (INFO): Should not import a p2sh-p2wpkh descriptor and have it set to active
2024-04-06T12:24:30.292000Z TestFramework (INFO): Should import a (non-active) p2sh-p2wpkh descriptor
2024-04-06T12:24:30.669000Z TestFramework (INFO): Should import a 1-of-2 bare multisig from descriptor
2024-04-06T12:24:30.701000Z TestFramework (INFO): Should not treat individual keys from the imported bare multisig as watchonly
2024-04-06T12:24:30.714000Z TestFramework (INFO): Ranged descriptors cannot have labels
2024-04-06T12:24:30.724000Z TestFramework (INFO): Private keys required for private keys enabled wallet
2024-04-06T12:24:30.741000Z TestFramework (INFO): Ranged descriptor import should warn without a specified range
2024-04-06T12:24:30.775000Z TestFramework (INFO): Should not import a ranged descriptor that includes xpriv into a watch-only wallet
2024-04-06T12:24:30.795000Z TestFramework (INFO): Should not import a descriptor with hardened derivations when private keys are disabled
2024-04-06T12:24:30.882000Z TestFramework (INFO): Verify we can only extend descriptor's range
2024-04-06T12:24:31.144000Z TestFramework (INFO): Check we can change descriptor internal flag
2024-04-06T12:24:31.372000Z TestFramework (INFO): Key ranges should be imported in order
2024-04-06T12:24:32.255000Z TestFramework (INFO): Check we can change next_index
2024-04-06T12:24:32.634000Z TestFramework (INFO): Check imported descriptors are not active by default
2024-04-06T12:24:32.707000Z TestFramework (INFO): Check can activate inactive descriptor
2024-04-06T12:24:32.804000Z TestFramework (INFO): Check can deactivate active descriptor
2024-04-06T12:24:32.902000Z TestFramework (INFO): Verify activation state is persistent
2024-04-06T12:24:33.479000Z TestFramework (INFO): Should import a descriptor with a WIF private key as spendable
2024-04-06T12:24:33.613000Z TestFramework (INFO): Test can import same descriptor with private key twice
2024-04-06T12:24:34.876000Z TestFramework (INFO): Test that multisigs can be imported, signed for, and getnewaddress'd
2024-04-06T12:24:35.465000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-06T12:24:38.152000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-06T12:24:39.820000Z TestFramework (INFO): Multisig with distributed keys
2024-04-06T12:24:40.664000Z TestFramework (INFO): We can create and use a huge multisig under P2WSH
2024-04-06T12:24:41.778000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-06T12:24:41.895000Z TestFramework (INFO): Under P2SH, multisig are standard with up to 15 compressed keys
2024-04-06T12:24:42.673000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-06T12:24:44.195000Z TestFramework (INFO): Amending multisig with new private keys
2024-04-06T12:24:44.673000Z TestFramework (INFO): Combo descriptors cannot be active
2024-04-06T12:24:44.689000Z TestFramework (INFO): Descriptors with no type cannot be active
2024-04-06T12:24:44.716000Z TestFramework (INFO): Test importing a descriptor to an encrypted wallet
2024-04-06T12:25:38.048000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_framework.py", line 132, in main
    self.run_test()
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/wallet_importdescriptors.py", line 692, in run_test
    importing = thread.submit(encrypted_wallet.importdescriptors, requests=[descriptor])
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/contextlib.py", line 124, in __exit__
    next(self.gen)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_node.py", line 490, in assert_debug_log
    self._raise_assertion_error('Expected messages "{}" does not partially match log:\n\n{}\n\n'.format(str(expected_msgs), print_log))
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_node.py", line 188, in _raise_assertion_error
    raise AssertionError(self._node_msg(msg))
AssertionError: [node 0] Expected messages "['Rescan started from block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206... (slow variant inspecting all blocks)']" does not partially match log:

 - 2024-04-06T12:25:08.046740Z [http] [httpserver.cpp:306] [http_request_cb] [http] Received a POST request for /wallet/encrypted_wallet from 127.0.0.1:52070
 - 2024-04-06T12:25:08.061430Z [httpworker.2] [rpc/request.cpp:187] [parse] [rpc] ThreadRPCServer method=importdescriptors user=__cookie__
 
 ...

 - 2024-04-06T12:25:18.066846Z [httpworker.2] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/var/folders/qy/mc4396sn0ql8dpl5q852sng40000gn/T/test_runner_₿_🏃_20240406_151754/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?)
 - 2024-04-06T12:25:18.072715Z [httpworker.2] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/var/folders/qy/mc4396sn0ql8dpl5q852sng40000gn/T/test_runner_₿_🏃_20240406_151754/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?)


2024-04-06T12:25:38.060000Z TestFramework (DEBUG): Closing down network thread
2024-04-06T12:25:38.118000Z TestFramework (INFO): Stopping nodes
2024-04-06T12:25:38.127000Z TestFramework.node0 (DEBUG): Stopping node
2024-04-06T12:25:38.132000Z TestFramework.node0 (ERROR): Unable to stop node.
Traceback (most recent call last):
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_node.py", line 375, in stop_node
    self.stop(wait=wait)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/coverage.py", line 50, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 127, in __call__
    response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 105, in _request
    self.__conn.request(method, path, postdata, headers)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1257, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1268, in _send_request
    self.putrequest(method, url, **skips)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1094, in putrequest
    raise CannotSendRequest(self.__state)
http.client.CannotSendRequest: Request-sent
2024-04-06T12:25:38.146000Z TestFramework.node1 (DEBUG): Stopping node
2024-04-06T12:26:38.208000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        self.wait_until(lambda: self.is_node_stopped(expected_ret_code=expected_ret_code, **kwargs), timeout=timeout)
'''

wallet_transactiontime_rescan log
2024-04-06T12:23:06.242000Z TestFramework (INFO): PRNG seed is: 2374416369969835520
2024-04-06T12:23:06.245000Z TestFramework (DEBUG): Setting up network thread
2024-04-06T12:23:06.246000Z TestFramework (INFO): Initializing test directory /var/folders/qy/mc4396sn0ql8dpl5q852sng40000gn/T/test_runner_₿_🏃_20240406_151754/wallet_transactiontime_rescan_173
2024-04-06T12:23:06.251000Z TestFramework (DEBUG): Copy cache directory /Users/ioannis/Documents/projects/bitcoin/bitcoin/test/cache/node0 to node 0
2024-04-06T12:23:06.308000Z TestFramework (DEBUG): Copy cache directory /Users/ioannis/Documents/projects/bitcoin/bitcoin/test/cache/node0 to node 1
2024-04-06T12:23:06.345000Z TestFramework (DEBUG): Copy cache directory /Users/ioannis/Documents/projects/bitcoin/bitcoin/test/cache/node0 to node 2
2024-04-06T12:23:06.354000Z TestFramework.node0 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-06T12:23:06.356000Z TestFramework.node1 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-06T12:23:06.360000Z TestFramework.node2 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-06T12:23:06.894000Z TestFramework.node0 (DEBUG): RPC successfully started
2024-04-06T12:23:06.913000Z TestFramework.node1 (DEBUG): RPC successfully started
2024-04-06T12:23:06.925000Z TestFramework.node2 (DEBUG): RPC successfully started
2024-04-06T12:23:10.098000Z TestFramework (DEBUG): Generate a block with current time
2024-04-06T12:23:10.104000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-06T12:23:10.634000Z TestFramework (INFO): Prepare nodes and wallet
2024-04-06T12:23:12.499000Z TestFramework (INFO): Start transactions
2024-04-06T12:23:17.588000Z TestFramework (INFO): Send 10 btc to user
2024-04-06T12:23:20.995000Z TestFramework (INFO): Send 5 btc to user
2024-04-06T12:23:25.219000Z TestFramework (INFO): Send 1 btc to user
2024-04-06T12:23:28.556000Z TestFramework (INFO): Check user's final balance and transaction count
2024-04-06T12:23:28.557000Z TestFramework (INFO): Check transaction times
2024-04-06T12:23:28.561000Z TestFramework (INFO): Restore user wallet on another node without rescan
2024-04-06T12:23:28.989000Z TestFramework (INFO): Rescan last history part
2024-04-06T12:23:29.008000Z TestFramework (INFO): Rescan all history
2024-04-06T12:23:29.038000Z TestFramework (INFO): Check user's final balance and transaction count after restoration
2024-04-06T12:23:29.066000Z TestFramework (INFO): Check transaction times after restoration
2024-04-06T12:23:29.086000Z TestFramework (INFO): Test handling of invalid parameters for rescanblockchain
2024-04-06T12:23:29.113000Z TestFramework (INFO): Test `rescanblockchain` fails when wallet is encrypted and locked
2024-04-06T12:23:30.408000Z TestFramework (INFO): Test rescanning an encrypted wallet
2024-04-06T12:24:02.955000Z TestFramework.bitcoincli (DEBUG): Running bitcoin-cli ['-rpcwallet=encrypted_wallet', 'walletpassphrase', 'passphrase', '1']
2024-04-06T12:24:45.454000Z TestFramework.bitcoincli (DEBUG): Running bitcoin-cli ['-rpcwallet=encrypted_wallet', 'walletlock']
2024-04-06T12:24:45.461000Z TestFramework.bitcoincli (DEBUG): Running bitcoin-cli ['-rpcwallet=encrypted_wallet', 'walletpassphrasechange', 'passphrase', 'newpassphrase']
2024-04-06T12:24:45.470000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 151, in _get_response
    http_response = self.__conn.getresponse()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1349, in getresponse
    response.begin()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 316, in begin
    version, status, reason = self._read_status()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 277, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/socket.py", line 704, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_framework.py", line 132, in main
    self.run_test()
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/wallet_transactiontime_rescan.py", line 221, in run_test
    assert_equal(rescanning.result(), {"start_height": 0, "stop_height": 803})
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/concurrent/futures/_base.py", line 438, in result
    return self.__get_result()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result
    raise self._exception
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/coverage.py", line 50, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 127, in __call__
    response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 106, in _request
    return self._get_response()
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 153, in _get_response
    raise JSONRPCException({
test_framework.authproxy.JSONRPCException: 'rescanblockchain' RPC took longer than 30.000000 seconds. Consider using larger timeout for calls that take longer to return. (-344)
2024-04-06T12:24:45.477000Z TestFramework (DEBUG): Closing down network thread
2024-04-06T12:24:45.532000Z TestFramework (INFO): Stopping nodes
2024-04-06T12:24:45.533000Z TestFramework.node0 (DEBUG): Stopping node
2024-04-06T12:24:45.539000Z TestFramework.node0 (ERROR): Unable to stop node.
Traceback (most recent call last):
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_node.py", line 375, in stop_node
    self.stop(wait=wait)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/coverage.py", line 50, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 127, in __call__
    response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 105, in _request
    self.__conn.request(method, path, postdata, headers)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1257, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1268, in _send_request
    self.putrequest(method, url, **skips)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1094, in putrequest
    raise CannotSendRequest(self.__state)
http.client.CannotSendRequest: Request-sent
2024-04-06T12:24:45.544000Z TestFramework.node1 (DEBUG): Stopping node
2024-04-06T12:24:45.545000Z TestFramework.node2 (DEBUG): Stopping node
2024-04-06T12:25:45.577000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        self.wait_until(lambda: self.is_node_stopped(expected_ret_code=expected_ret_code, **kwargs), timeout=timeout)
'''

feature_index_prune

This test passed today on both runs on the PR branch, so I only include the log file from the failure I encountered in yesterday's tests (again on the PR branch).

feature_index_prune.py                                 | ✖ Failed  | 183 s 
feature_index_prune log file
2024-04-05T17:00:49.259000Z TestFramework (INFO): PRNG seed is: 4962004092256186875
2024-04-05T17:00:49.259000Z TestFramework (DEBUG): Setting up network thread
2024-04-05T17:00:49.260000Z TestFramework (INFO): Initializing test directory /var/folders/qy/mc4396sn0ql8dpl5q852sng40000gn/T/test_runner_₿_🏃_20240405_200041/feature_index_prune_302
2024-04-05T17:00:49.261000Z TestFramework (DEBUG): Copy cache directory /Users/ioannis/Documents/projects/bitcoin/bitcoin/test/cache/node0 to node 0
2024-04-05T17:00:49.273000Z TestFramework (DEBUG): Copy cache directory /Users/ioannis/Documents/projects/bitcoin/bitcoin/test/cache/node0 to node 1
2024-04-05T17:00:49.285000Z TestFramework (DEBUG): Copy cache directory /Users/ioannis/Documents/projects/bitcoin/bitcoin/test/cache/node0 to node 2
2024-04-05T17:00:49.407000Z TestFramework (DEBUG): Copy cache directory /Users/ioannis/Documents/projects/bitcoin/bitcoin/test/cache/node0 to node 3
2024-04-05T17:00:49.914000Z TestFramework.node0 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-05T17:00:49.938000Z TestFramework.node1 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-05T17:00:49.962000Z TestFramework.node2 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-05T17:00:50.006000Z TestFramework.node3 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-05T17:00:51.965000Z TestFramework.node0 (DEBUG): RPC successfully started
2024-04-05T17:00:51.983000Z TestFramework.node1 (DEBUG): RPC successfully started
2024-04-05T17:00:52.007000Z TestFramework.node2 (DEBUG): RPC successfully started
2024-04-05T17:00:52.035000Z TestFramework.node3 (DEBUG): RPC successfully started
2024-04-05T17:00:52.080000Z TestFramework (DEBUG): Generate a block with current time
2024-04-05T17:00:52.086000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-05T17:00:52.957000Z TestFramework (INFO): check if we can access blockfilters and coinstats when pruning is enabled but no blocks are actually pruned
2024-04-05T17:00:53.259000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-05T17:00:55.968000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-05T17:01:00.604000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-05T17:01:00.646000Z TestFramework (INFO): prune some blocks
2024-04-05T17:01:00.702000Z TestFramework (INFO): check if we can access the tips blockfilter and coinstats when we have pruned some blocks
2024-04-05T17:01:00.767000Z TestFramework (INFO): check if we can access the blockfilter and coinstats of a pruned block
2024-04-05T17:01:00.818000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-05T17:01:02.172000Z TestFramework.node0 (DEBUG): Stopping node
2024-04-05T17:01:02.390000Z TestFramework.node0 (DEBUG): Node stopped
2024-04-05T17:01:02.393000Z TestFramework.node0 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-05T17:01:02.918000Z TestFramework.node0 (DEBUG): RPC successfully started
2024-04-05T17:01:02.918000Z TestFramework.node1 (DEBUG): Stopping node
2024-04-05T17:01:03.084000Z TestFramework.node1 (DEBUG): Node stopped
2024-04-05T17:01:03.090000Z TestFramework.node1 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-05T17:01:03.613000Z TestFramework.node1 (DEBUG): RPC successfully started
2024-04-05T17:01:03.621000Z TestFramework.node2 (DEBUG): Stopping node
2024-04-05T17:01:03.745000Z TestFramework.node2 (DEBUG): Node stopped
2024-04-05T17:01:03.748000Z TestFramework.node2 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-05T17:01:04.009000Z TestFramework.node2 (DEBUG): RPC successfully started
2024-04-05T17:01:04.311000Z TestFramework (INFO): make sure trying to access the indices throws errors
2024-04-05T17:01:04.368000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-05T17:01:06.939000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-05T17:01:11.514000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-05T17:01:16.719000Z TestFramework (INFO): prune exactly up to the indices best blocks while the indices are disabled
2024-04-05T17:01:16.757000Z TestFramework.node0 (DEBUG): Stopping node
2024-04-05T17:01:16.987000Z TestFramework.node0 (DEBUG): Node stopped
2024-04-05T17:01:16.991000Z TestFramework.node0 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-05T17:01:17.525000Z TestFramework.node0 (DEBUG): RPC successfully started
2024-04-05T17:01:17.647000Z TestFramework.node1 (DEBUG): Stopping node
2024-04-05T17:01:17.933000Z TestFramework.node1 (DEBUG): Node stopped
2024-04-05T17:01:17.944000Z TestFramework.node1 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-05T17:01:18.733000Z TestFramework.node1 (DEBUG): RPC successfully started
2024-04-05T17:01:18.785000Z TestFramework.node2 (DEBUG): Stopping node
2024-04-05T17:01:19.015000Z TestFramework.node2 (DEBUG): Node stopped
2024-04-05T17:01:19.020000Z TestFramework.node2 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-05T17:01:19.552000Z TestFramework.node2 (DEBUG): RPC successfully started
2024-04-05T17:01:19.552000Z TestFramework (INFO): make sure that we can continue with the partially synced indices after having pruned up to the index height
2024-04-05T17:01:24.744000Z TestFramework (INFO): prune further than the indices best blocks while the indices are disabled
2024-04-05T17:01:24.745000Z TestFramework.node0 (DEBUG): Stopping node
2024-04-05T17:01:24.913000Z TestFramework.node0 (DEBUG): Node stopped
2024-04-05T17:01:24.919000Z TestFramework.node0 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-05T17:01:25.187000Z TestFramework.node0 (DEBUG): RPC successfully started
2024-04-05T17:01:25.190000Z TestFramework.node1 (DEBUG): Stopping node
2024-04-05T17:01:25.362000Z TestFramework.node1 (DEBUG): Node stopped
2024-04-05T17:01:25.367000Z TestFramework.node1 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-05T17:01:26.173000Z TestFramework.node1 (DEBUG): RPC successfully started
2024-04-05T17:01:26.173000Z TestFramework.node2 (DEBUG): Stopping node
2024-04-05T17:01:26.345000Z TestFramework.node2 (DEBUG): Node stopped
2024-04-05T17:01:26.347000Z TestFramework.node2 (DEBUG): bitcoind started, waiting for RPC to come up
2024-04-05T17:01:26.884000Z TestFramework.node2 (DEBUG): RPC successfully started
2024-04-05T17:01:27.436000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-05T17:01:43.914000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-05T17:02:00.011000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-05T17:02:21.406000Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
2024-04-05T17:02:51.411000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 151, in _get_response
    http_response = self.__conn.getresponse()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1349, in getresponse
    response.begin()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 316, in begin
    version, status, reason = self._read_status()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 277, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/socket.py", line 704, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_framework.py", line 132, in main
    self.run_test()
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/feature_index_prune.py", line 121, in run_test
    self.mine_batches(1000)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/feature_index_prune.py", line 47, in mine_batches
    self.generate(self.nodes[0], 250)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_framework.py", line 695, in generate
    blocks = generator.generate(*args, invalid_call=False, **kwargs)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_node.py", line 333, in generate
    return self.generatetoaddress(nblocks=nblocks, address=self.get_deterministic_priv_key().address, maxtries=maxtries, **kwargs)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_node.py", line 341, in generatetoaddress
    return self.__getattr__('generatetoaddress')(*args, **kwargs)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/coverage.py", line 50, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 127, in __call__
    response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 106, in _request
    return self._get_response()
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 153, in _get_response
    raise JSONRPCException({
test_framework.authproxy.JSONRPCException: 'generatetoaddress' RPC took longer than 30.000000 seconds. Consider using larger timeout for calls that take longer to return. (-344)
2024-04-05T17:02:51.444000Z TestFramework (DEBUG): Closing down network thread
2024-04-05T17:02:51.521000Z TestFramework (INFO): Stopping nodes
2024-04-05T17:02:51.548000Z TestFramework.node0 (DEBUG): Stopping node
2024-04-05T17:02:51.575000Z TestFramework.node0 (ERROR): Unable to stop node.
Traceback (most recent call last):
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/test_node.py", line 375, in stop_node
    self.stop(wait=wait)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/coverage.py", line 50, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 127, in __call__
    response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
  File "/Users/ioannis/Documents/projects/bitcoin/bitcoin/test/functional/test_framework/authproxy.py", line 105, in _request
    self.__conn.request(method, path, postdata, headers)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1257, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1268, in _send_request
    self.putrequest(method, url, **skips)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1094, in putrequest
    raise CannotSendRequest(self.__state)
http.client.CannotSendRequest: Request-sent
2024-04-05T17:02:51.588000Z TestFramework.node1 (DEBUG): Stopping node
2024-04-05T17:02:51.652000Z TestFramework.node2 (DEBUG): Stopping node
2024-04-05T17:02:51.677000Z TestFramework.node3 (DEBUG): Stopping node
2024-04-05T17:03:51.817000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        self.wait_until(lambda: self.is_node_stopped(expected_ret_code=expected_ret_code, **kwargs), timeout=timeout)
'''

@itornaza
Copy link
Contributor

itornaza commented Apr 6, 2024

Out of frustration I took slightly different approach and run the functional tests with the support of a big enough ramdisk of 12 GiB inspired by the PR #29335 that was meant for a completely different use case.

Not only all the extended tests pass on both the master and PR branches with 16 jobs and even 64 jobs but a 2x speed up is achieved down to 572 seconds.

My box has 96 GiB of unified memory so there is clearly some operating systems specifics that make the discussed tests to fail. Under the much smaller but more controlled environment of the ramdisk, everything runs smoothly.

On that note I would consider suggesting that the tests are advised to be run with a big enough ramdisk support in the README.md and at least for the mac users.

@fanquake
Copy link
Member

fanquake commented Apr 7, 2024

cc @m3dwards, as I think you had been seeing these timeouts as well.

@fanquake fanquake merged commit 03e94f8 into bitcoin:master Apr 7, 2024
16 checks passed
@cbergqvist
Copy link
Contributor Author

Happy for my first merged PR! :)

Post-merge post-mortem

Working stupidly, not smart or hard

I have spent too many evenings focusing on this:

Agree that it might be fruitful to investigate the history of wallet_importdescriptors.py to pinpoint regressions, didn't have time today.

In over >110 runs, I have observed how the chance of wallet_importdescriptors.py --descriptors failure has increased with time. As patterns emerged around certain commits, I've tested further only to have the ratio of success/failure converge to around the same number before & after commits.

In hindsight, instead of hoping to get lucky in manually finding the offending commit, I should have been "lazy" and written an automated script to perform a larger number of runs to actually be able to get a large enough sample size to provide confidence. I think the threshold in wallet_importdescriptors.py changed by this PR is so close to the average runtime, that a really large sample size would be required. Maybe it's a case of death by a thousand cuts rather than a specific change.

Build configuration

For posterity, I was building with Clang 17.0.6, C & C++ compiler flags -O0 -g, --with-debug and --with-gui=qt5 (yes, the last one is probably unnecessary in the context of this test). As optimizations are off and debugging is on it becomes more probably to see timeouts, but it's still good to be able to run tests in such a context.

Future directions

  • Implement/find tool for gathering statistical data on test failures over a range of commits.
  • Investigate why feature_dbcrash.py runs in ~45 minutes on my machine/build configuration while it takes something like 5 minutes on others.
  • Add build information into combined test logs.

@cbergqvist cbergqvist deleted the bump_timeouts branch April 8, 2024 12:38
Pttn added a commit to RiecoinTeam/Riecoin that referenced this pull request Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants