Merge bitcoin/bitcoin#35954: qa: Disable Qt's glib event dispatcher for GUI tests on OpenBSD

de2adc308a qa: Disable Qt's glib event dispatcher for GUI tests on OpenBSD (Hennadii Stepanov)

Pull request description:

  When `bitcoin-gui` is built against OpenBSD's system Qt packages (which have GLib support), shutdown emits "GLib-CRITICAL **: g_main_context_pop_thread_default: assertion 'stack != NULL' failed" messages on `stderr`, which the test framework treats as a failure.

  Set `QT_NO_GLIB=1` so Qt falls back to its poll-based event dispatcher, which avoids the GLib thread-default context entirely.

  Fixes https://github.com/bitcoin/bitcoin/issues/35851.

  See the CI log here: https://github.com/hebasto/bitcoin-core-nightly/actions/runs/31510478034.

ACKs for top commit:
  maflcko:
    lgtm ACK de2adc308a

Tree-SHA512: edc991c7a174bc304a4da0ca29ec97bcaece463289de3da5350a046f1133ce6d830c37d5188536ca2ce238d462e56de8f2167fdeeb1d1e5ecca38d60c8495cce
This commit is contained in:
merge-script
2026-08-18 11:07:29 +01:00

View File

@@ -287,6 +287,17 @@ class TestNode():
# does not provide. In particular, painting a QGroupBox can make Qt call
# addSubview: on an invalid native object (QTBUG-49686).
subp_env.setdefault("QT_STYLE_OVERRIDE", "fusion")
if platform.system() == "OpenBSD":
# The system Qt packages are built with GLib support, so Qt uses
# QEventDispatcherGlib, which pushes/pops the GLib thread-default
# main context in each thread. On OpenBSD the pop can run during
# thread exit after GLib's per-thread context stack has already
# been torn down, so shutdown emits messages like
# (process:NNN): GLib-CRITICAL **: g_main_context_pop_thread_default:
# assertion 'stack != NULL' failed
# on stderr, which the test framework treats as a failure.
# Fall back to Qt's poll-based event dispatcher instead.
subp_env.setdefault("QT_NO_GLIB", "1")
subp_env.setdefault("LC_ALL", "nl_NL.UTF-8") # Set language to try to trigger translation bugs
if sys.platform.startswith("linux") and "XDG_RUNTIME_DIR" not in subp_env:
# Qt prints warnings to stderr when XDG_RUNTIME_DIR is unset or has wrong