Keyboard input in the test suite is flaky on Wayland
The following discussion from !838 (merged) should be addressed:
-
@intrigeri started a discussion: (+4 comments) - test suite does not find the DuckDuckGo search prompt, while it's visible on the failure screenshot
The code that's involved is:
- our own
Screen#press
calls https://libvirt.org/ruby/api/Libvirt/Domain.html#method-i-send_key - https://libvirt.org/ruby/api/Libvirt/Domain.html#method-i-send_key calls https://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSendKey
-
https://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSendKey calls
conn->driver->domainSendKey
, which in our case isqemuDomainSendKey
(https://sources.debian.org/src/libvirt/8.10.0-1/src/qemu/qemu_driver.c/?hl=20813#L20813) -
qemuDomainSendKey
→qemuMonitorSendKey
→qemuMonitorJSONSendKey
, which callsqemuMonitorJSONMakeCommand
with thesend-key
argument, and passes its result toqemuMonitorJSONCommand
; all this interacts with the "QEMU monitor console" - eventually we end up in
hmp_sendkey
→qmp_sendkey
→qemu_input_event_send_key_delay
, which useskbd_default_delay_ms = 10
as the default hold time
Note: the doc says the default hold time is 100 ms, which was indeed the case initially, but since https://salsa.debian.org/qemu-team/qemu/-/commit/2e377f1730d06deafb3e3ef6cf88792de4a6f4df it uses kbd_default_delay_ms
, which has been 10 ms since it was introduced in 2014.
Failing test runs:
- https://jenkins.tails.boum.org/job/test_Tails_ISO_stable/4731/cucumber-html-reports/report-feature_20_1315884850.html: Looks like the Return key was received twice, because the video shows that the "configure language" menu is immediately closed after it opened. (video, debug.log)
-
https://jenkins.tails.boum.org/job/test_Tails_ISO_stable/4732/cucumber-html-reports/report-feature_40_3251716293.html: Looks like the
@screen.press('alt', 'k')
resulted in a "k" being entered in the text entry. (video)
Edited by segfault