action #31327
closed
[functional][opensuse][u][sporadic]test fails in updates_packagekit_kde - part 1
Added by StefanBruens almost 7 years ago.
Updated over 6 years ago.
Category:
Bugs in existing tests
Target version:
SUSE QA (private) - Milestone 17
Description
Observation¶
openQA test in scenario opensuse-Tumbleweed-DVD-aarch64-kde@aarch64 fails in
updates_packagekit_kde
This is a race condition.
Abbreviate test code:
while (1) {
assert_and_click('updates_click-install');
# Wait until installation is done
assert_screen \@updates_installed_tags, 3600;
wait_still_screen;
...
}
The problem apparently is the check "races" through the loop although it
should wait at the assert_screen.
Unfortunately the assert_screen also matches the screen from the initial
condition, i.e. 'updates_click_install'.
The assert_and_click should be an "assert_and_click_and_wait_screen_change".
Reproducible¶
Fails since (at least) Build 20171011
Expected result¶
Last good: 20170929 (or more recent)
Further details¶
Always latest result in this scenario: latest
There already is a suitable function in lib/utils.pm:
sub assert_and_click_until_screen_change(match, timeout=2, repeat=3)
So this probably would work:
- assert_and_click('updates_click-install');
+ assert_and_click_until_screen_change('updates_click-install');
The test still fails.
There is another race condition in
sub assert_and_click_until_screen_change
Whats likely happening:
- Mouse is clicked
- Button changes appearance (depressed)
- Mouse is released
- Button changes appearance to normal
-> screen change registered
->
check_screen($mustmatch)
matches
- Update starts
->
assert_and_click
times out
The probaly correct and trivial solution is to change the
wait_screen_change(sub { assert_and_click $mustmatch }, $wait_change);
last unless check_screen($mustmatch, 0);
in assert_and_click_until_screen_change
to
my changed = wait_screen_change(sub { assert_and_click $mustmatch }, $wait_change);
last if changed;
as the only reason for the check_screen
likely is to differentiate between timeout and changed screen.
assert_and_click_until_screen_change
originates from https://github.com/os-autoinst/os-autoinst-distri-opensuse/commit/66be570b0e8924f31939b8df14caa613603a75e3#diff-3bc674bd584cb5d70e3543f91838634d , and references #19082
Test is still not robust - https://openqa.opensuse.org/tests/612040/file/autoinst-log.txt
[2018-02-17T05:20:22.0877 CET] [debug] send_pointer_event 0, 802, 705, 1
...
[2018-02-17T05:20:23.0886 CET] [debug] >>> testapi::wait_screen_change: screen change seen at 0
[2018-02-17T05:20:23.0886 CET] [debug] /var/lib/openqa/share/tests/opensuse/tests/update/updates_packagekit_kde.pm:41 called testapi::assert_screen
[2018-02-17T05:20:23.0887 CET] [debug] <<< testapi::assert_screen(mustmatch=[
'updates_none',
'updates_available'
], timeout=3600)
[2018-02-17T05:20:23.0950 CET] [debug] MATCH(updates_none-20160523:0.00)
...
[2018-02-17T05:20:25.0031 CET] [debug] >>> testapi::_handle_found_needle: found updates_kde-updates_available-20180124, similarity 1.00 @ 680/400
The match uses a screen registered immediately after the mouse button release.
- Subject changed from test fails in updates_packagekit_kde to [functional][opensuse]test fails in updates_packagekit_kde
- Target version set to Milestone 16
- Related to action #30085: [functional][u][medium] test fails in updates_packagekit_gpk - no restarting packagekit daemon after libzypp update added
- Related to action #16432: [functional][u][medium]test fails in updates_packagekit_kde assuming "install updates" when there are no more added
- Related to action #31912: [opensuse][functional][u] test fails in updates_packagekit_kde - part 2 added
- Related to action #28875: [sle][functional][sporadic][hard][u] test fails in updates_packagekit_gpk - updater should not be started when already running added
- Subject changed from [functional][opensuse]test fails in updates_packagekit_kde to [functional][opensuse]test fails in updates_packagekit_kde - part 1
- Related to deleted (action #31912: [opensuse][functional][u] test fails in updates_packagekit_kde - part 2)
- Precedes action #31912: [opensuse][functional][u] test fails in updates_packagekit_kde - part 2 added
- Subject changed from [functional][opensuse]test fails in updates_packagekit_kde - part 1 to [functional][opensuse][u][sporadic]test fails in updates_packagekit_kde - part 1
- Due date set to 2018-04-24
- Target version changed from Milestone 16 to Milestone 15
- Related to action #30811: [opensuse][leap][functional][u]test fails in updates_packagekit_gpk - packagekit to quit not running added
- Target version changed from Milestone 15 to Milestone 17
Shifting to later, we don't have enough capacity in the upcomping sprints.
- Due date deleted (
2018-04-24)
I think this can be closed - I have not seen the packagekit test fail for some time.
See #31327#note-5 for the applied fix.
- Status changed from New to Resolved
- Assignee set to StefanBruens
ok, thank you for taking a look. Let's assume you fixed it ;)
- Target version changed from Milestone 17 to Milestone 17
Also available in: Atom
PDF