ci: failure in `wallet_importdescriptors.py ` #35544

issue fanquake opened this issue on June 16, 2026
  1. fanquake commented at 3:34 PM on June 16, 2026: member

    https://github.com/bitcoin/bitcoin/actions/runs/27626623050/job/81689877009?pr=35537:

    2026-06-16T15:17:31.3998250Z  node0 2026-06-16T15:17:21.699894Z [http.00] [wallet/sqlite.cpp:55] [TraceSqlCallback] [walletdb:trace] [/Users/runner/work/bitcoin/bitcoin/repo_archive/ci/scratch_ ₿🧪_/test_runner/test_runner_₿_🏃_20260616_150224/wallet_importdescriptors_103/node0/regtest/wallets/abort_import_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?) 
    2026-06-16T15:17:31.3999070Z  node0 2026-06-16T15:17:21.699970Z [http.00] [wallet/wallet.h:939] [WalletLogPrintf] [abort_import_wallet] RescanFromTime: Rescanning last 329 blocks 
    2026-06-16T15:17:31.3999900Z  node0 2026-06-16T15:17:21.699981Z [http.00] [wallet/wallet.h:939] [WalletLogPrintf] [abort_import_wallet] Rescan started from block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206... (slow variant inspecting all blocks) 
    2026-06-16T15:17:31.4000360Z  node0 2026-06-16T15:17:21.705100Z [http.00] [wallet/wallet.h:939] [WalletLogPrintf] [abort_import_wallet] Scanning current mempool transactions. 
    2026-06-16T15:17:31.4000970Z  node0 2026-06-16T15:17:21.705121Z [http.00] [wallet/wallet.h:939] [WalletLogPrintf] [abort_import_wallet] Rescan completed in               5ms 
    2026-06-16T15:17:31.4001230Z  test  2026-06-16T15:17:21.705640Z TestFramework (ERROR): Unexpected exception: 
    2026-06-16T15:17:31.4001400Z                                    Traceback (most recent call last):
    2026-06-16T15:17:31.4001830Z                                      File "/Users/runner/work/bitcoin/bitcoin/repo_archive/test/functional/test_framework/test_framework.py", line 144, in main
    2026-06-16T15:17:31.4001970Z                                        self.run_test()
    2026-06-16T15:17:31.4002090Z                                        ~~~~~~~~~~~~~^^
    2026-06-16T15:17:31.4002700Z                                      File "/Users/runner/work/bitcoin/bitcoin/repo_archive/ci/scratch_ ₿🧪_/build-aarch64-apple-darwin24.6.0/test/functional/wallet_importdescriptors.py", line 962, in run_test
    2026-06-16T15:17:31.4002880Z                                        self.test_rescan_fails_import()
    2026-06-16T15:17:31.4003060Z                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
    2026-06-16T15:17:31.4003710Z                                      File "/Users/runner/work/bitcoin/bitcoin/repo_archive/ci/scratch_ ₿🧪_/build-aarch64-apple-darwin24.6.0/test/functional/wallet_importdescriptors.py", line 193, in test_rescan_fails_import
    2026-06-16T15:17:31.4003990Z                                        raise AssertionError("importdescriptors unexpectedly succeeded")
    2026-06-16T15:17:31.4004520Z                                    AssertionError: importdescriptors unexpectedly succeeded
    2026-06-16T15:17:31.4004800Z  test  2026-06-16T15:17:21.709227Z TestFramework (DEBUG): Closing down network thread 
    
  2. fanquake added the label CI failed on Jun 16, 2026
  3. fanquake commented at 3:36 PM on June 16, 2026: member
  4. polespinasa commented at 3:43 PM on June 16, 2026: member
    2026-06-16T15:17:22.3162210Z 2026-06-16T15:17:21.137717Z TestFramework (INFO): Aborting an importdescriptors rescan should fail the RPC call
    2026-06-16T15:17:22.3162690Z 2026-06-16T15:17:21.705640Z TestFramework (ERROR): Unexpected exception:
    2026-06-16T15:17:22.3163000Z Traceback (most recent call last):
    2026-06-16T15:17:22.3163450Z   File "/Users/runner/work/bitcoin/bitcoin/repo_archive/test/functional/test_framework/test_framework.py", line 144, in main
    2026-06-16T15:17:22.3163980Z     self.run_test()
    2026-06-16T15:17:22.3164120Z     ~~~~~~~~~~~~~^^
    2026-06-16T15:17:22.3164940Z   File "/Users/runner/work/bitcoin/bitcoin/repo_archive/ci/scratch_ ₿🧪_/build-aarch64-apple-darwin24.6.0/test/functional/wallet_importdescriptors.py", line 962, in run_test
    2026-06-16T15:17:22.3165530Z     self.test_rescan_fails_import()
    2026-06-16T15:17:22.3165780Z     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
    2026-06-16T15:17:22.3171280Z   File "/Users/runner/work/bitcoin/bitcoin/repo_archive/ci/scratch_ ₿🧪_/build-aarch64-apple-darwin24.6.0/test/functional/wallet_importdescriptors.py", line 193, in test_rescan_fails_import
    2026-06-16T15:17:22.3173720Z     raise AssertionError("importdescriptors unexpectedly succeeded")
    2026-06-16T15:17:22.3175000Z AssertionError: importdescriptors unexpectedly succeeded
    

    The test failing is the "abort rescan" case. The test fails due to a race condition in the c++ code. It can happen that an abortrescan call is ignored by the actual rescan code.

    #35512 should fix it by moving the code that makes the rescan ignore the abortrescan call

  5. Sjors commented at 3:02 PM on June 19, 2026: member
  6. pinheadmz commented at 10:31 PM on June 21, 2026: member

    Another failure, same test but not the race patched in #35512

    https://github.com/bitcoin/bitcoin/actions/runs/27913805625/job/82595425742?pr=35182

    Failed in the ancestor commits test. I don't think its related to the PR because at that commit nothing significant has been changed in the HTTP server (just implementing new classes)

    2026-06-21T19:27:55.6660429Z  test  2026-06-21T19:27:49.552619Z TestFramework (INFO): Test importdescriptors fails when wallet is already rescanning 
    ...
    2026-06-21T19:27:57.2336099Z  node0 2026-06-21T19:27:52.326674Z [http.01] [wallet/wallet.h:939] [WalletLogPrintf] [rescan_wallet] Scanning current mempool transactions. 
    2026-06-21T19:27:57.2336326Z  node0 2026-06-21T19:27:52.326680Z [http.01] [wallet/wallet.h:939] [WalletLogPrintf] [rescan_wallet] Rescan completed in              35ms 
    2026-06-21T19:27:57.2336466Z  test  2026-06-21T19:27:52.327147Z TestFramework (ERROR): Unexpected exception: 
    2026-06-21T19:27:57.2336557Z                                    Traceback (most recent call last):
    2026-06-21T19:27:57.2336897Z                                      File "/home/runner/work/bitcoin/bitcoin/test/functional/test_framework/test_framework.py", line 145, in main
    2026-06-21T19:27:57.2336971Z                                        self.run_test()
    2026-06-21T19:27:57.2337208Z                                      File "/home/runner/work/bitcoin/bitcoin/ci_build/test/functional/wallet_importdescriptors.py", line 962, in run_test
    2026-06-21T19:27:57.2337298Z                                        self.test_rescan_fails_import()
    2026-06-21T19:27:57.2337565Z                                      File "/home/runner/work/bitcoin/bitcoin/ci_build/test/functional/wallet_importdescriptors.py", line 164, in test_rescan_fails_import
    2026-06-21T19:27:57.2337648Z                                        assert_equal(num_success, 1)
    2026-06-21T19:27:57.2337883Z                                      File "/home/runner/work/bitcoin/bitcoin/test/functional/test_framework/util.py", line 94, in assert_equal
    2026-06-21T19:27:57.2338158Z                                        raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
    2026-06-21T19:27:57.2338282Z                                    AssertionError: not(2 == 1)
    
  7. hiSandog commented at 9:35 AM on June 25, 2026: none

    The later failure in the ancestor-commits test looks like it may be a second timing assumption in the same functional test, not just the abortrescan path fixed by #35512. In both snippets the rescan can complete very quickly before the test observes the intended blocked/aborted state. If possible, making the test hold the rescan at a deterministic synchronization point would avoid asserting on a race between the RPC call and a very short rescan.

  8. polespinasa commented at 9:39 AM on June 25, 2026: member

    If possible, making the test hold the rescan at a deterministic synchronization point would avoid asserting on a race between the RPC call and a very short rescan.

    I don't think this is possible. #35579 should fix the race condition reported in #35544 (comment) by prioritizing checking the reservation of wallet rescan before any lock is taken.

  9. maflcko added this to the milestone 32.0 on Jun 26, 2026
  10. hebasto commented at 9:10 AM on June 28, 2026: member

    Another failure, same test but not the race patched in #35512

    Happened on FreeBSD 14.4 as well:

    2026-06-28T07:54:41.768861Z TestFramework (INFO): Test older() safety
    2026-06-28T07:54:41.797294Z TestFramework (INFO): Test import of unused(KEY)
    2026-06-28T07:54:41.988492Z TestFramework (INFO): Test import of unused(KEY) with existing KEY
    2026-06-28T07:54:42.007588Z TestFramework (INFO): Test import of unused(KEY) to wallet without privkeys
    2026-06-28T07:54:42.028605Z TestFramework (INFO): Test importdescriptors fails when wallet is already rescanning
    2026-06-28T07:54:47.258072Z TestFramework (ERROR): Unexpected exception:
    Traceback (most recent call last):
      File "/root/bitcoin/test/functional/test_framework/test_framework.py", line 145, in main
        self.run_test()
      File "/root/build/test/functional/wallet_importdescriptors.py", line 994, in run_test
        self.test_rescan_fails_import()
      File "/root/build/test/functional/wallet_importdescriptors.py", line 168, in test_rescan_fails_import
        assert_equal(num_success, 1)
      File "/root/bitcoin/test/functional/test_framework/util.py", line 94, in assert_equal
        raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
    AssertionError: not(2 == 1)
    
  11. hebasto commented at 10:28 AM on July 6, 2026: member

    ... and on NetBSD 10.1:

    2026-07-06T07:09:32.900122Z TestFramework (INFO): Test older() safety
    2026-07-06T07:09:33.011553Z TestFramework (INFO): Test import of unused(KEY)
    2026-07-06T07:09:33.918427Z TestFramework (INFO): Test import of unused(KEY) with existing KEY
    2026-07-06T07:09:35.198930Z TestFramework (INFO): Test import of unused(KEY) to wallet without privkeys
    2026-07-06T07:09:35.462252Z TestFramework (INFO): Test importdescriptors fails when wallet is already rescanning
    2026-07-06T07:10:26.660729Z TestFramework (ERROR): Unexpected exception:
    Traceback (most recent call last):
      File "/root/bitcoin/test/functional/test_framework/test_framework.py", line 145, in main
        self.run_test()
        ~~~~~~~~~~~~~^^
      File "/root/build/test/functional/wallet_importdescriptors.py", line 994, in run_test
        self.test_rescan_fails_import()
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
      File "/root/build/test/functional/wallet_importdescriptors.py", line 168, in test_rescan_fails_import
        assert_equal(num_success, 1)
        ~~~~~~~~~~~~^^^^^^^^^^^^^^^^
      File "/root/bitcoin/test/functional/test_framework/util.py", line 94, in assert_equal
        raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
    AssertionError: not(2 == 1)
    

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-07-09 06:47 UTC