Skip to content

qa: Broken wallet_multiwallet.py #31409

Closed

Description

@hebasto

On the master branch @ ebe4cac, the wallet_multiwallet.py test has several issues:

  1. This code:

    os.mkdir(wallet_dir('no_access'))
    os.chmod(wallet_dir('no_access'), 0)
    try:
    with self.nodes[0].assert_debug_log(expected_msgs=['Error scanning']):
    walletlist = self.nodes[0].listwalletdir()['wallets']
    finally:
    # Need to ensure access is restored for cleanup
    os.chmod(wallet_dir('no_access'), stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
    assert_equal(sorted(map(lambda w: w['name'], walletlist)), sorted(in_wallet_dir))
    checks for the "Error scanning" message in the debug.log caused by processing the no_access directory. However, the same message can also be generated when parsing the self_walletdat_symlink directory. As a result, the current implementation is prone to producing false-positive results.

  2. Parsing the self_walletdat_symlink directory with bitcoind.exe depends on how it was built. When cross-compiling, the parsing completes without system errors. On the other hand, when building natively, it raises an "unknown error" exception and logs the "Error scanning" message.

  3. This code:

    os.mkdir(wallet_dir('no_access'))
    os.chmod(wallet_dir('no_access'), 0)
    try:
    with self.nodes[0].assert_debug_log(expected_msgs=['Error scanning']):
    walletlist = self.nodes[0].listwalletdir()['wallets']
    finally:
    # Need to ensure access is restored for cleanup
    os.chmod(wallet_dir('no_access'), stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
    is not portable due to its use of os.chmod:

Note: Although Windows supports chmod(), you can only set the file’s read-only flag with it (via the stat.S_IWRITE and stat.S_IREAD constants or a corresponding integer value).

Activity

  1. maflcko commented on Dec 3, 2024

    @maflcko
    Member

    I guess it would be good to separate the no_access and symlink unit tests into two test cases, not combine them into one. This would allow to skip just one of them, if needed on Windows.

  2. added a commit that references this issue on Mar 13, 2026
    92a3d30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions