Project

General

Profile

Actions

action #42362

closed

[qe-core][qem][virtio][sle15sp0][sle15sp1][desktop][typing] test fails in window_system because "typing string is too fast in wayland"

Added by zcjia over 5 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Bugs in existing tests
Target version:
-
Start date:
2018-10-12
Due date:
% Done:

0%

Estimated time:
Difficulty:

Description

Observation

openQA test in scenario sle-15-SP1-Installer-DVD-x86_64-desktopapps-remote-client1@64bit-virtio-vga fails in
window_system

There are many failures in "window_system" here: https://openqa.suse.de/tests/overview?distri=sle&version=15-SP1&build=66.2&groupid=118

These failures can go away if you restart the jobs a few times, but it should get proper fix.

The cause is that "script_output" calls "type_string", which types many characters too fast into gnome, causing some characters missing or repeated.

Similar issues happens on PPC64 platform, so there is "VNC_TYPING_LIMIT=10" in ppc64 worker.

I tested on OSD, this setting works fine for gnome.

(This setting means how many keys are typed into VNC in one second, default value is 50.)

In other tests, there are also typing failures from time to time.

@Oliver:

So I wonder if this setting should be added to the sle-15-desktop medium type?

Reproducible

Fails since (at least) Build 66.2 (current job)

Expected result

Last good: 63.1 (or more recent)

Further details

Always latest result in this scenario: latest

possible misstype ninjakeys


Files

gnome_wayland_qxl2.png (87.8 KB) gnome_wayland_qxl2.png zgao, 2018-12-04 08:50
gnome_wayland_qxl.png (156 KB) gnome_wayland_qxl.png zgao, 2018-12-04 08:50
gnome_wayland_virtio.png (143 KB) gnome_wayland_virtio.png zgao, 2018-12-04 08:50
gnome_wayland_virtio2.png (74.5 KB) gnome_wayland_virtio2.png zgao, 2018-12-04 08:50
gnome_x11_qxl.png (178 KB) gnome_x11_qxl.png zgao, 2018-12-04 08:50
gnome_x11_virtio.png (189 KB) gnome_x11_virtio.png zgao, 2018-12-04 08:50
kde_wayland_virtio.png (97.7 KB) kde_wayland_virtio.png zgao, 2018-12-04 08:50
kde_wayland_virtio2.png (72.2 KB) kde_wayland_virtio2.png zgao, 2018-12-04 08:50
kde_x11_qxl.png (137 KB) kde_x11_qxl.png zgao, 2018-12-04 08:50
kde_wayland_qxl.png (156 KB) kde_wayland_qxl.png zgao, 2018-12-04 08:50
qemu_vnc_keypress.jpg (147 KB) qemu_vnc_keypress.jpg zgao, 2018-12-14 11:38

Related issues 6 (1 open5 closed)

Related to openQA Tests - action #41681: [desktop][sporadic][virtio] test fails in window_system to open windows or type correctly - related to wayland/virtio?ResolvedGraceWang2018-09-27

Actions
Related to openQA Tests - action #53339: [opensuse] test fails in swing due to incorrect rendering on 16bpp framebuffersResolvedokurz2019-06-19

Actions
Related to openQA Tests - action #60257: [functional][u][mistyping] random typing issues on waylandRejectedmgriessmeier2019-11-25

Actions
Related to openQA Infrastructure - action #139271: Repurpose PowerPC hardware in FC Basement - mania Power8 PowerPC size:MResolvedokurz2023-09-20

Actions
Has duplicate openQA Tests - action #51332: [sle][functional][u] test fails in firefox - wrong html page loadedRejectedokurz2019-05-09

Actions
Blocks openQA Tests - coordination #43889: [qe-core][epic][functional][virtio][wayland] openQA makes spelling mistakesBlocked

Actions
Actions #1

Updated by okurz over 5 years ago

zcjia wrote:

@Oliver:
So I wonder if this setting should be added to the sle-15-desktop medium type?

I doubt this is a good idea. Also I do not think that "we type too fast". I guess the system is just loaded and a bit unresponsive just after startup. One can consider this a product bug.

I would suggest an approach similar to
https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/5365
which ensures with the desktop_runner module that there is a certain "cool down time" directly after login. I suggest to involve jbaier as the test module maintainer of window_system to handle this.

Actions #2

Updated by osukup over 5 years ago

  • Subject changed from [sle15sp1][desktop] test fails in window_system because "typing string is too fast in gnome" to [qam][sle15sp0][sle15sp1][desktop] test fails in window_system because "typing string is too fast in gnome"

same on qam jobs .. time to time this fails with typing issues

Actions #3

Updated by zcjia over 5 years ago

@Oliver, I can confirm that the system load is not high when this error happens. Also, this error can happen elsewhere every now and then, which is very annoying.

I talked to another QA, his opinion and experience is that openQA is typing too fast: 50 key strokes a second is indeed too fast, especially for a desktop environment.

@jbaier, what's your opinion on this matter?

Actions #4

Updated by jbaier_cz over 5 years ago

For me it is a little bit weird. It was working quite confidently at the time of the development. Now I see those errors more and more often. Of course, I can rewrite the test (at the cost of loosing the record_info feature for pretty presentation), however this issue could come back in other tests as there are a few tests which types in the terminal.

It would be nice to know the root of the issue (load on the worker / openQA backend issue / unreliable typing short after boot).

Actions #5

Updated by zcjia over 5 years ago

  • Status changed from New to In Progress

There are failures in palaces other than "window_system", for example in "firefox_smoke":

https://openqa.suse.de/tests/2216384#next_previous

And I have an important discovery: all these "typing too fast" failures happen in wayland instead of X11.

I'll try to dig deeper.

Actions #6

Updated by zcjia over 5 years ago

  • Assignee set to zcjia
Actions #7

Updated by dzedro over 5 years ago

I think problem is in broken key presses with QEMUVGA=std or QEMUGA=virtio

Actions #8

Updated by zcjia over 5 years ago

The reason to use QEMUVGA=virtio for wayland is that wayland doesn't support the default "cirrus", see https://progress.opensuse.org/issues/21786

Actions #9

Updated by zcjia over 5 years ago

  • Subject changed from [qam][sle15sp0][sle15sp1][desktop] test fails in window_system because "typing string is too fast in gnome" to [qam][sle15sp0][sle15sp1][desktop] test fails in window_system because "typing string is too fast in wayland"

I tested X11+virtio, there's no problem; so the problem happens in wayland+virtio.

I'll try to reproduce this problem outside of openQA.

Actions #10

Updated by yfjiang over 5 years ago

Hi @zcjia, @okurz, I saw an upstream bug of qemu was reported https://bugs.launchpad.net/qemu/+bug/1802465 , it looks X is also affected but wayland is more easy to be impacted with a shorter length of trigger string. The problem is we are not sure how the issue will be escalated yet.

By the fact that there are quite some desktop testing of SLE-15-SP1 desktop were blocked by this issue, and Alpha-3 is coming:

http://openqa.suse.de/tests/overview?distri=sle&version=15-SP1&build=88.6&groupid=118

Is there a way to add an acceptable workaround to make the testing run more reliably? Thank you!

Actions #11

Updated by zcjia over 5 years ago

Since SLE-15-SP1-Alpha3 is coming, I will apply the workaround on OSD:

by adding "VNC_TYPING_LIMIT=10" to machine type "64bit-virtio-vga".

Let's see how it goes.

Actions #12

Updated by okurz over 5 years ago

Yes, I think this is a good idea. As long as you call the ticket only done when you removed that workaround again I am fine ;)

Actions #13

Updated by okurz over 5 years ago

  • Related to action #41681: [desktop][sporadic][virtio] test fails in window_system to open windows or type correctly - related to wayland/virtio? added
Actions #14

Updated by szarate over 5 years ago

  • Description updated (diff)

So, looking at this... looks to me again to missing keys/ninjakeys: https://openqa.suse.de/tests/2167333#step/window_system/4 if you look closely... the N is never let go and looking at the latest job: https://openqa.suse.de/tests/2277128 there's a poem missing there... and the same for other jobs in the build...

Actions #15

Updated by szarate over 5 years ago

  • Related to coordination #43889: [qe-core][epic][functional][virtio][wayland] openQA makes spelling mistakes added
Actions #16

Updated by okurz over 5 years ago

  • Subject changed from [qam][sle15sp0][sle15sp1][desktop] test fails in window_system because "typing string is too fast in wayland" to [qam][virtio][sle15sp0][sle15sp1][desktop] test fails in window_system because "typing string is too fast in wayland"

yes, but in this example again it's specific to virtio, see #41681

Updated by zgao over 5 years ago

I ran several tests with respect to

  • qxl or virtio
  • x11 or wayland
  • gnome or kde

It seems to me that:

  • qxl seems to mitigate the problem, if you could compare gnome_wayland_qxl.png to gnome_wayland_virtio.png in the attachment

  • x11 has much fewer typing misses but once in a while it still happens

  • A special case ABCDE causes high miss rate on shift key(around 50%) for both x11 and wayland, please refer to *2.png in the attachment

Above is my option and it's merely based on my observation. I ran around 1000 characters for each test. Qemu version based on stable-2.12 and queue_count enlarged to 102400.

What you do think? What other things can we tweak?

Actions #18

Updated by okurz over 5 years ago

Good evaluation. I wonder why you selected libreoffice though. IMHO libreoffice is especially prone to cause mistyping, see #43889, maybe because of "spell correction" or something. The original ticket observation was about "window_system" so maybe the results would actually be different if you would conduct the experiment in a more "simple" environment, e.g. gedit/kwrite

Actions #19

Updated by zgao over 5 years ago

Thank you!
I actually tested on both gedit and libreoffice. I will proceed with gedit here after.

I found a special case about sending key streams ending with a uppercase letter, e.g. ABCDE, AbC, aaaC

If you could refer to gnome_wayland_virtio2.png, gnome_wayland_qxl2.png or kde_wayland_virtio2.png in the above attachment, you could found there's a obvious miss on lowercase or uppercase every two times.

The reason is as follows, when we send one character A, the key code sent is actually like

  1. capslock pressed
  2. a pressed
  3. enter pressed So capslock is always used instead of shift and now capslock gets toggled.

If a lowercase letter comes after a capital letter, the capslock would be pressed again so capslock will get back to normal.
But if key stream ends with a uppercase letter, it is observed that capslock is not pressed again and therefore toggled.

Now I'm wondering which part of code actually deals with capslock, is it ps2 driver handling it or vncdotool?
What do you think?

Actions #20

Updated by okurz over 5 years ago

Are you sure it's "caps lock" or just "shift"? I guess that it is either qemu or VNC, I doubt that vncdotool is involved here at all. https://build.opensuse.org/package/view_file/Virtualization/qemu/0025-Fix-tigervnc-long-press-issue.patch?expand=1 might be related? Just browsed the web quickly myself, maybe https://www.berrange.com/posts/2010/07/04/more-than-you-or-i-ever-wanted-to-know-about-virtual-keyboard-handling/ helps. Sorry, can't help more.

Actions #21

Updated by zgao over 5 years ago

Thank you for the comment!!

An update about this issue,

I checked on guest OS regarding what values kernel receive, and it turns out to be wrong.

  • First on guest OS, I found the keyboard device at /dev/input/eventX, X might subject to be any number.
  • Then I monitor what this device -- eventX receives by evtest /dev/input/eventX

According to my observation, there are key misses at /dev/input/eventX. But I have not yet find any key wrongly ordered. A key miss might cause a lot more errors on x11 or wayland.

Additionally, qemu has vnc layer, input event queue layer, ps2 key queue layer. I printed values in the queues of these lays --- and found out they are all accurate.

So I presume it is a problem about qemu interfacing with guest kernel.
I attached a graph how qemu deals with key inputs, it's made by me and hope it helps.

Actions #22

Updated by okurz over 5 years ago

wow, I appreciate your fine detailed investigation notes, especially the picture can help understanding, thx.

Actions #23

Updated by zgao about 5 years ago

I found the bug resides both in qemu internals and in wayland.

In qemu, it is a concurrency problem since capslock LED is handled by another thread --- so keycode streams get messed up when capslock LED is emitted.

I opened up a bug on qemu upstream

The bug regarding wayland is observed when kernel event device receives correct keycode streams, gedit still shows wrong values. It seems to be relevant to bug 1117833: Wayland: briefffffffffff unresponsivvvvvvvvvvvveness and repeated keys This bug is not observed on x11.

To check if kernel is to blame or not, I used ftrace and dynamic_debug to peek into what kernel receives. It seems kernel receives what qemu sends it and passes all recognized key streams to /dev/input/event.

Actions #24

Updated by zgao about 5 years ago

Found related bug report related to fedora.

Bug 1658676 - Typing '<' more than once (with the specific keypress sequence used by os-autoinst) breaks with usb-kbd and VNC

Also,
'Less than' (<), 'more than' (>), and 'pipe' (|) can't be typed via VNC

Additionally, I will pay some attention to wayland bug, since it happens much more often comparably.

Actions #25

Updated by zgao about 5 years ago

Issue raised on gnome-shell gitlab
As pointed out by zcjia, wayland typing issue only happens after gnome-shell 3.2.6.

Noted that this wayland issue is to be blame for severe typing flaws on wayland under gnome.

But typing issues on openQA involves qemu issues, and possibly other parts ---we found that create_hdd_* cases might have user name typed wrong, but I failed to reproduce this problem in installed x11 instance where I tested around 250,000 characters through vnc 10ms per char.

You could refer to gnome-gdm, where typing user name went wrong 3 out of the 10 times from 20181214 to 20190103. They fail at first_boot
Also, in this case and this case

Actions #26

Updated by okurz about 5 years ago

Regarding wrong user name typing during installation: That should fail the test earlier in https://openqa.opensuse.org/tests/829175#step/user_settings/2 with the right needle. It looks like the last matched needle has vanished. Maybe you are onto this already?

Actions #27

Updated by SLindoMansilla almost 5 years ago

  • Related to deleted (coordination #43889: [qe-core][epic][functional][virtio][wayland] openQA makes spelling mistakes)
Actions #28

Updated by SLindoMansilla almost 5 years ago

  • Blocks coordination #43889: [qe-core][epic][functional][virtio][wayland] openQA makes spelling mistakes added
Actions #29

Updated by okurz almost 5 years ago

  • Has duplicate action #51332: [sle][functional][u] test fails in firefox - wrong html page loaded added
Actions #30

Updated by okurz over 4 years ago

  • Related to action #53339: [opensuse] test fails in swing due to incorrect rendering on 16bpp framebuffers added
Actions #31

Updated by AdamWill over 4 years ago

This ticket is kinda more broad than my specific issue, but I did notice one very specific issue with the Firefox Wayland native backend (specifically, it does not happen with the X11 backend): typing modified characters fails very often. See https://bugzilla.redhat.com/show_bug.cgi?id=1727388 . I found that reversing the order of the 'key up' events when doing modified characters - so e.g. to type a colon we do:

  1. shift down
  2. ; down
  3. ; up
  4. shift up

instead of this:

  1. shift down
  2. ; down
  3. shift up
  4. ; up

works around that problem; https://github.com/os-autoinst/os-autoinst/pull/1174 is my PR for that.

Actions #32

Updated by AdamWill over 4 years ago

For the record, in the Fedora tests we commonly use our type_slowly and type_very_slowly macros for typing in GNOME (and KDE), exactly because we've seen this kind of problem before. type_slowly just slows down the typing speed. type_very_slowly slows it down even more, and does a wait_screen_change between each key press.

Actions #33

Updated by okurz over 4 years ago

Hi @zcjia, @zgao the issue of problems with typing characters persists as also the linked tickets describe, e.g. #43889 . What are your plans on working on this issue?

Actions #34

Updated by zcjia over 4 years ago

okurz wrote:

Hi @zcjia, @zgao the issue of problems with typing characters persists as also the linked tickets describe, e.g. #43889 . What are your plans on working on this issue?

Hi Oliver, (zgao was an intern and left the company), this problem is caused by multiple sources, one of them is the version of GNOME. I will give this problem another try as we are going to GNOME 3.34 in SLE15SP2.

Actions #35

Updated by okurz over 4 years ago

I saw the latest problem in Tumbleweed where there is already gnome 3.34 so no need to wait :)

Actions #36

Updated by okurz about 4 years ago

  • Related to action #60257: [functional][u][mistyping] random typing issues on wayland added
Actions #37

Updated by bmwiedemann almost 4 years ago

For the record: the original rate was 6.66 keystrokes/s from
https://github.com/os-autoinst/os-autoinst/blob/v1/bmwqemu.pm#L398
That was still using the qemu monitor interface where capital letters were one "sendkey shift-n".

And when typing longer strings, it would wait for output to catch up after 13 chars:
https://github.com/os-autoinst/os-autoinst/blob/v1/bmwqemu.pm#L423
mostly meant for isolinux and grub where BIOS keystroke buffer was limited to 15 and graphics could take a while to redraw. But I also remember cases where KDE was slow to react and slower typing helped.

Actions #38

Updated by tjyrinki_suse over 3 years ago

  • Subject changed from [qam][virtio][sle15sp0][sle15sp1][desktop] test fails in window_system because "typing string is too fast in wayland" to [qe-core][qam][virtio][sle15sp0][sle15sp1][desktop] test fails in window_system because "typing string is too fast in wayland"
Actions #39

Updated by tjyrinki_suse over 3 years ago

  • Subject changed from [qe-core][qam][virtio][sle15sp0][sle15sp1][desktop] test fails in window_system because "typing string is too fast in wayland" to [qe-core][qem][virtio][sle15sp0][sle15sp1][desktop] test fails in window_system because "typing string is too fast in wayland"
Actions #40

Updated by tjyrinki_suse almost 3 years ago

  • Subject changed from [qe-core][qem][virtio][sle15sp0][sle15sp1][desktop] test fails in window_system because "typing string is too fast in wayland" to [qe-core][qem][virtio][sle15sp0][sle15sp1][desktop][typing] test fails in window_system because "typing string is too fast in wayland"
Actions #41

Updated by slo-gin over 1 year ago

This ticket was set to Normal priority but was not updated within the SLO period. Please consider picking up this ticket or just set the ticket to the next lower priority.

Actions #42

Updated by zcjia over 1 year ago

  • Status changed from In Progress to Resolved

Resolving this issue:

First, the "slow typing" issue almost never happen in recent release (SLE15SP4).

Second, now the "window_system" uses serial console instead of graphic terminal.

Actions #43

Updated by okurz 4 months ago

  • Related to action #139271: Repurpose PowerPC hardware in FC Basement - mania Power8 PowerPC size:M added
Actions

Also available in: Atom PDF