Project

General

Profile

Actions

action #31327

closed

[functional][opensuse][u][sporadic]test fails in updates_packagekit_kde - part 1

Added by StefanBruens over 6 years ago. Updated almost 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Bugs in existing tests
Target version:
SUSE QA - Milestone 17
Start date:
2018-02-02
Due date:
% Done:

0%

Estimated time:
Difficulty:

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


Related issues 5 (0 open5 closed)

Related to openQA Tests - action #30085: [functional][u][medium] test fails in updates_packagekit_gpk - no restarting packagekit daemon after libzypp updateResolvedriafarov2018-01-092018-04-10

Actions
Related to openQA Tests - action #16432: [functional][u][medium]test fails in updates_packagekit_kde assuming "install updates" when there are no moreResolvedjorauch2017-02-022018-05-08

Actions
Related to openQA Tests - action #28875: [sle][functional][sporadic][hard][u] test fails in updates_packagekit_gpk - updater should not be started when already runningResolvedjorauch2017-12-052018-05-22

Actions
Related to openQA Tests - action #30811: [opensuse][leap][functional][u]test fails in updates_packagekit_gpk - packagekit to quit not runningResolvedJERiveraMoya2018-01-252018-06-19

Actions
Precedes (1 day) openQA Tests - action #31912: [opensuse][functional][u] test fails in updates_packagekit_kde - part 2Resolvedjorauch2018-02-062018-07-31

Actions
Actions #1

Updated by StefanBruens over 6 years ago

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');
Actions #3

Updated by StefanBruens about 6 years ago

The test still fails.

There is another race condition in
sub assert_and_click_until_screen_change

Whats likely happening:

  1. Mouse is clicked
  2. Button changes appearance (depressed)
  3. Mouse is released
  4. Button changes appearance to normal -> screen change registered -> check_screen($mustmatch) matches
  5. 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

Actions #4

Updated by StefanBruens about 6 years ago

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.

Actions #6

Updated by okurz about 6 years ago

  • Subject changed from test fails in updates_packagekit_kde to [functional][opensuse]test fails in updates_packagekit_kde
  • Target version set to Milestone 16
Actions #7

Updated by okurz about 6 years ago

  • Related to action #30085: [functional][u][medium] test fails in updates_packagekit_gpk - no restarting packagekit daemon after libzypp update added
Actions #8

Updated by okurz about 6 years ago

  • Related to action #16432: [functional][u][medium]test fails in updates_packagekit_kde assuming "install updates" when there are no more added
Actions #9

Updated by okurz about 6 years ago

  • Related to action #31912: [opensuse][functional][u] test fails in updates_packagekit_kde - part 2 added
Actions #10

Updated by okurz about 6 years ago

  • Related to action #28875: [sle][functional][sporadic][hard][u] test fails in updates_packagekit_gpk - updater should not be started when already running added
Actions #11

Updated by okurz about 6 years ago

  • Subject changed from [functional][opensuse]test fails in updates_packagekit_kde to [functional][opensuse]test fails in updates_packagekit_kde - part 1
Actions #12

Updated by okurz about 6 years ago

  • Related to deleted (action #31912: [opensuse][functional][u] test fails in updates_packagekit_kde - part 2)
Actions #13

Updated by okurz about 6 years ago

  • Precedes action #31912: [opensuse][functional][u] test fails in updates_packagekit_kde - part 2 added
Actions #14

Updated by okurz about 6 years ago

  • 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
Actions #15

Updated by okurz about 6 years ago

  • Related to action #30811: [opensuse][leap][functional][u]test fails in updates_packagekit_gpk - packagekit to quit not running added
Actions #16

Updated by okurz about 6 years ago

  • Target version changed from Milestone 15 to Milestone 17

Shifting to later, we don't have enough capacity in the upcomping sprints.

Actions #17

Updated by okurz about 6 years ago

  • Due date deleted (2018-04-24)
Actions #18

Updated by StefanBruens about 6 years ago

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.

Actions #19

Updated by okurz about 6 years ago

  • Status changed from New to Resolved
  • Assignee set to StefanBruens

ok, thank you for taking a look. Let's assume you fixed it ;)

Actions #20

Updated by okurz almost 6 years ago

  • Target version changed from Milestone 17 to Milestone 17
Actions

Also available in: Atom PDF