action #17058
closed[tools]mouse_hide produces "Use of uninitialized value"
0%
Description
https://openqa.suse.de/tests/775167/file/autoinst-log.txt
11:08:54.5087 Debug: /var/lib/openqa/share/tests/sle/tests/installation/welcome.pm:38 called testapi::mouse_hide
11:08:54.5088 31889 <<< testapi::mouse_hide(border_offset=0)
Use of uninitialized value in numeric eq (==) at /usr/lib/os-autoinst/consoles/vnc_base.pm line 169.
11:08:54.5092 32004 mouse_move 1023, 767
11:08:54.5092 32004 send_pointer_event 0, 1023, 767, 1
Not affecting anything, pointer gets hidden, just the warning.
Updated by okurz almost 8 years ago
- Category set to Regressions/Crashes
- Target version set to Milestone 6
Updated by okurz almost 8 years ago
- Target version changed from Milestone 6 to Milestone 7
Updated by dheidler almost 8 years ago
- Assignee set to dheidler
In sub connect_vnc
:
$self->{mouse} = {x => undef, y => undef};
In sub _mouse_move
:
if ($self->{mouse}->{x} == $x && $self->{mouse}->{y} == $y) {
Updated by dheidler almost 8 years ago
- Status changed from New to In Progress
Updated by RBrownSUSE almost 8 years ago
- Subject changed from mouse_hide produces "Use of uninitialized value" to [tools]mouse_hide produces "Use of uninitialized value"
Updated by AdamWill almost 8 years ago
This was a bad idea: it actually breaks some of our tests.
The problem is a bad interaction with assert_and_click
, which after it clicks inside the match location, does this:
if (defined $old_mouse_coords->{x} && defined $old_mouse_coords->{y}) {
return mouse_set($old_mouse_coords->{x}, $old_mouse_coords->{y});
}
else {
return mouse_hide();
}
The problem is that after this change, $old_mouse_coords->{x}
and $old_mouse_coords->{y}
are always defined - they're just defined to -1, if the mouse has never been explicitly positioned before the assert_and_click
call. So instead of doing mouse_hide()
in this case, as it did before, assert_and_click
winds up calling mouse_set(-1, -1)
. I dunno if the behaviour of that is defined in the VNC spec, but what it seems to do in practice at least in qemu is either not move the mouse at all or just move it 1 pixel in each direction (I can't really tell which).
This breaks several of our tests which need to click the same button twice, because the second assert_and_click
fails because there's now a mouse cursor sitting on top of the button.
Fix should be pretty simple, I think, just change:
if (defined $old_mouse_coords->{x} && defined $old_mouse_coords->{y})
to:
if ($old_mouse_coords->{x} > -1 && $old_mouse_coords->{y} > -1)
I'll send a PR.
Updated by dheidler over 7 years ago
Adam's PR got merged: d8f75d2bc24f63a58545d20b79064a7131d41aa2