Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t: Fix sporadic test failure in ui/13-admin.t #5568

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

okurz
Copy link
Member

@okurz okurz commented Apr 8, 2024

There was a sporadic failure originally observed in CI runs with very low
failure ratio looking like this

t/ui/13-admin.t .. 14/?
        #   Failed test 'exactly one key present'
        #   at t/ui/13-admin.t line 681.
        #          got: '0'
        #     expected: '1'

I reproduced the problem locally with

runs=200 OPENQA_TEST_TIMEOUT_DISABLE=1 count-fail-ratio make test KEEP_DB=1
TESTS=t/ui/13-admin.t

with results fails: 4. Fail ratio 2.00±1.94%, mean runtime: 39.0±3.0 s.

With make coverage the results were fails 7. Fail ratio 3.50±2.54%,
mean runtime: 80 s so slightly higher fail ratio with double runtime.

This commit uses "wait_for_element" combining the submit action with the lookup
of the resulting table rows to properly synchronize the action and waiting for
result. This fixes the problem. Verified with 400 runs with a computed failure
probability of less than .75%.

Previously I tried to just wait for "#api-keys-tbody > tr" in
"wait_for_element" but running into sporadic issues with similar failure rate
as in before. Apparently the key creation never yields a valid table
representation in this case without retriggering the action.

Related progress issue: https://progress.opensuse.org/issues/158422

t/ui/13-admin.t Outdated Show resolved Hide resolved
t/ui/13-admin.t Outdated Show resolved Hide resolved
t/ui/13-admin.t Outdated Show resolved Hide resolved
There was a sporadic failure originally observed in CI runs with very low
failure ratio looking like this

```
t/ui/13-admin.t .. 14/?
        #   Failed test 'exactly one key present'
        #   at t/ui/13-admin.t line 681.
        #          got: '0'
        #     expected: '1'
```

I reproduced the problem locally with

```
runs=200 OPENQA_TEST_TIMEOUT_DISABLE=1 count-fail-ratio make test KEEP_DB=1
TESTS=t/ui/13-admin.t
```

with results fails: 4. Fail ratio 2.00±1.94%, mean runtime: 39.0±3.0 s.

With `make coverage` the results were fails 7. Fail ratio 3.50±2.54%,
mean runtime: 80 s so slightly higher fail ratio with double runtime.

This commit uses "wait_for_element" combining the submit action with the lookup
of the resulting table rows to properly synchronize the action and waiting for
result. This fixes the problem. Verified with 400 runs with a computed failure
probability of less than .75%.

Previously I tried to just wait for "#api-keys-tbody > tr" in
"wait_for_element" but running into sporadic issues with similar failure rate
as in before. Apparently the key creation never yields a valid table
representation in this case without retriggering the action.

Related progress issue: https://progress.opensuse.org/issues/158422
@okurz okurz force-pushed the fix/t_ui_13admin_poo158422 branch from a991924 to c45f64d Compare April 8, 2024 14:28
@okurz
Copy link
Member Author

okurz commented Apr 8, 2024

Updated

  • wait_for_element … or return instead of redundant array size checks
  • Using #api-keys-tbody tr:nth-child(2) to select the actual needed second element

Copy link

codecov bot commented Apr 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.39%. Comparing base (edc562a) to head (c45f64d).
Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5568   +/-   ##
=======================================
  Coverage   98.39%   98.39%           
=======================================
  Files         392      392           
  Lines       38232    38233    +1     
=======================================
+ Hits        37619    37620    +1     
  Misses        613      613           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mergify mergify bot merged commit f600ce3 into os-autoinst:master Apr 8, 2024
35 checks passed
@okurz okurz deleted the fix/t_ui_13admin_poo158422 branch April 8, 2024 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants