Skip to content

test: load the harness defaults and the test options in one call - #3249

Open
italopaesano wants to merge 1 commit into
WayfireWM:masterfrom
italopaesano:fix/test-harness-config
Open

italopaesano wants to merge 1 commit into
WayfireWM:masterfrom
italopaesano:fix/test-harness-config

Conversation

@italopaesano

Copy link
Copy Markdown
Contributor

test_config_backend_t::init() called load_configuration_options_from_string()
twice: once for the defaults every test needs, once for the options of the
individual test. The second call undoes part of the first one, because the
function treats each string as the complete configuration -- it is the same
path which reloads wayfire.ini -- and therefore ends by resetting every
registered option which is absent from the string it was given.

So every test which passes options of its own silently lost the defaults. The
one that shows is xwayland = false, whose default is true: the resize, touch,
keyboard-config, pointer-scroll-speed and native-buffer-size-scaling tests
spawned 15 Xwayland servers between them, nine in the resize test alone, none
of which they use. While probing for a free display those log "Failed to bind
socket @/tmp/.X11-unix/X0: Address already in use" and compete for display
numbers with each other and with the session running the suite. core/plugins
fell back to the default list of 26 plugins, and autostart_wf_shell to true;
those are harmless today only because the tests which do start plugins also
set plugins themselves. None of this shows on CI, where wlroots is built
without xwayland support, so core/xwayland has no effect and the two tests
which use Xwayland are not built at all.

Load the defaults and the options of the test in a single call, defaults first
so that the test still takes precedence. The options of a test have to open
their own section, which every test already does.

Those five tests now spawn no Xwayland server, and the two tests which do use
Xwayland still spawn exactly one each.

Co-Authored-By: Claude noreply@anthropic.com

test_config_backend_t::init() called load_configuration_options_from_string()
twice: once for the defaults every test needs, once for the options of the
individual test. The second call undoes part of the first one, because the
function treats each string as the complete configuration -- it is the same
path which reloads wayfire.ini -- and therefore ends by resetting every
registered option which is absent from the string it was given.

So every test which passes options of its own silently lost the defaults. The
one that shows is xwayland = false, whose default is true: the resize, touch,
keyboard-config, pointer-scroll-speed and native-buffer-size-scaling tests
spawned 15 Xwayland servers between them, nine in the resize test alone, none
of which they use. While probing for a free display those log "Failed to bind
socket @/tmp/.X11-unix/X0: Address already in use" and compete for display
numbers with each other and with the session running the suite. core/plugins
fell back to the default list of 26 plugins, and autostart_wf_shell to true;
those are harmless today only because the tests which do start plugins also
set plugins themselves. None of this shows on CI, where wlroots is built
without xwayland support, so core/xwayland has no effect and the two tests
which use Xwayland are not built at all.

Load the defaults and the options of the test in a single call, defaults first
so that the test still takes precedence. The options of a test have to open
their own section, which every test already does.

Those five tests now spawn no Xwayland server, and the two tests which do use
Xwayland still spawn exactly one each.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant