#36190 test: Check bitcoin wrapper child exit status on windows

full analysis

https://github.com/bitcoin/bitcoin/pull/36190 · Bortlesboat · +79/-19 in 6 files, 6 commits · labels: Utils/log/libs

Goal

  • Verify that the Windows bitcoin wrapper blocks until its child finishes and correctly forwards exit codes
  • Ensure scripts and callers invoking bitcoind via the wrapper get reliable exit codes and error reports

Adds functional tests to tool_bitcoin.py verifying that the Windows bitcoin wrapper blocks until its child finishes, forwards the child process exit codes (including negative exit codes like -1), and reports launch failures when the child executable cannot be executed.

Problem: The Windows bitcoin wrapper previously conflated child exit status -1 with process spawn failures under _spawnvp, causing incorrect exit codes when a child exited with -1. Test coverage was needed to prevent regressions in exit status forwarding and error reporting on Windows.

Category: Tools and scripts (#2 of 22)

P3 · test coverage

  • P3 because it validates wrapper tool behavior on Windows
  • Ensures exit codes are preserved reliably for scripts and callers invoking the wrapper

P3 because it validates wrapper tool functionality on Windows. It ensures exit codes are preserved reliably for scripts and callers invoking bitcoind via the bitcoin wrapper.

Membership: Covers the bitcoin executable wrapper tool and adds functional testing in tool_bitcoin.py.

Factors: security/stability 0, bug 1, performance 0, user value 1, leverage 1

Category: Utilities (logging, arguments, libraries) (#28 of 66)

P3 · test coverage

  • P3 because it pins process spawning and error propagation under Windows CRT quirks
  • Prevents regressions in return code handling and errno mapping

P3 because it pins the behavior of ExecVp when dealing with Windows CRT quirks such as return codes and errno mapping.

Membership: Labeled Utils/log/libs due to testing util::ExecVp process spawning and error propagation on Windows.

Factors: security/stability 0, bug 1, performance 0, user value 1, leverage 1

Reviewability: Ready: Review #36105 first

  • Review #36105 first
  • Code is ready, but it depends on the runtime wrapper fixes in base PR #36105

The PR is clean and tests pass, but it depends on the runtime wrapper fixes currently in base PR #36105.

Author status: active, addressed reviewer suggestions with updated tests

Resolved concerns:

  • cyb3ralbert noted that the test only covered successful spawn with negative child exit code, not spawn failures; author added test_launch_failure to cover failed spawns across platforms.

Agreement: Strong

  • Strong support with cross-platform testing
  • Verified on native Windows runners with UCRT and MSVCRT (cyb3ralbert)
  • Supported splitting this test out into a dedicated PR (ryanofsky)

Strong support; cyb3ralbert tested on Windows and Linux and gave ACK, ryanofsky coordinated splitting the test from #36105

Base author ryanofsky agreed to keep the test in this follow-up PR, and cyb3ralbert tested cross-built binaries on native Windows runners with both UCRT and MSVCRT before ACKing.

  • ryanofsky dropped the test from #36105 and supported reviewing it here
  • cyb3ralbert verified the exit code -1 failure against the old wrapper and suggested adding launch-failure coverage
  • cyb3ralbert gave full ACK after testing commit f2a1beb2 on Linux and Windows

Review verdicts (DrahtBot): 1

Dependencies

Depends on: #36105

Based on (shares commits with): #36105

Files

69 lines under test/bench/ci.

  • test/functional/tool_bitcoin.py +41/-10
  • src/bitcoin.cpp +16/-1
  • test/functional/interface_gui.py +6/-7
  • src/util/exec.cpp +11/-1
  • test/functional/test_framework/test_framework.py +4/-0
  • test/config.ini.in +1/-0

Card

This PR adds functional tests for the bitcoin wrapper tool on Windows in tool_bitcoin.py. It verifies that the wrapper waits for its child process, passes through exit codes including negative values like -1, and correctly flags launch errors when the child executable is absent. It is stacked on top of #36105, which contains the underlying runtime fix for ExecVp. Review is straightforward and agreement is strong, with cyb3ralbert testing across Windows CRT environments and providing an ACK.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T17:12, confidence high, input hash d0bae0803dd33d28