Some GTK UI tests are flaky due to timeout

Bug #1780767 reported by Didier Roche-Tolomelli
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Apport
Fix Released
Low
Unassigned
apport (Ubuntu)
Fix Released
High
Brian Murray
Bionic
Fix Released
Medium
Brian Murray
Focal
New
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

The autopkgtests are sometimes passing, sometimes stuck for more than 2h:
http://autopkgtest.ubuntu.com/packages/apport/cosmic/amd64.
It's blocking randomly on different tests.

All tests that are stucked, implements closing a request via a timeout (and then, executing "run"). The bet is that the timeout is short enough (1s) so that, when autopkgtests infra is busy, time to execute the bash subcommand is taking more than a second, and so "dismissing" is ran before execution happens and the whole testsuite hangs.

There are few instances of setting this timeout function:
$ grep eout_add_sec test/*
test/test_ui_gtk.py: GLib.timeout_add_seconds(1, cont)
test/test_ui_gtk.py: GLib.timeout_add_seconds(1, cont)
test/test_ui_gtk.py: GLib.timeout_add_seconds(1, cont)
test/test_ui_gtk.py: GLib.timeout_add_seconds(1, c)
test/test_ui_gtk.py: GLib.timeout_add_seconds(1, c)

Short term solution could be to increase the timeout. Long term would be to eliminate this potential race implementing cancelling differently. The short term workaround to increase the timeout increases the test execution time by five minutes.

[Test Plan]

Check that the autopkgtest succeed on all architectures (except for i386).

[Where problems could occur]

The test cases are only part of the apport source package and are not copied in any binary packages. Changes to the test will only affect the package build and test execution.

tags: added: rls-cc-incoming
Changed in apport (Ubuntu):
status: New → In Progress
assignee: nobody → Brian Murray (brian-murray)
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.20.10-0ubuntu7

---------------
apport (2.20.10-0ubuntu7) cosmic; urgency=medium

  * tests/test_ui_gtk.py: Increase the timeout so that when the autopkgtest
    infrastructure is busy the tests should not fail. (LP: #1780767)

 -- Brian Murray <email address hidden> Tue, 24 Jul 2018 08:03:49 -0700

Changed in apport (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Could this be backported to bionic with the next SRU? We're possibly seeing the same timeout issues there.

Changed in apport (Ubuntu Bionic):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Brian Murray (brian-murray)
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Didier, or anyone else affected,

Accepted apport into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apport/2.20.9-0ubuntu7.5 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in apport (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Brian Murray (brian-murray) wrote : Re: Some tests are flaky due to timeout

The i386 and amd64 autopkgtests passed for Ubuntu 18.04 with the new version of apport in -proposed.

http://autopkgtest.ubuntu.com/packages/a/apport/bionic/amd64
http://autopkgtest.ubuntu.com/packages/a/apport/bionic/i386

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for apport has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote : Re: Some tests are flaky due to timeout

This bug was fixed in the package apport - 2.20.9-0ubuntu7.5

---------------
apport (2.20.9-0ubuntu7.5) bionic; urgency=medium

  * apport/ui.py: when using ubuntu-bug properly handle executables which
    start with /snap/bin. (LP: #1760220)
  * test/test_ui_gtk.py: Increase the timeout so that when the autopkgtest
    infrastructure is busy the tests should not fail. (LP: #1780767)

 -- Brian Murray <email address hidden> Fri, 02 Nov 2018 08:19:37 -0700

Changed in apport (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Interesting. This bug was 'fixed' for bionic in 2018, but now it's referenced again in 2022 for jammy. Was it a fix that got missed forward-porting? Or are we simply re-using existing bugs?

Revision history for this message
Benjamin Drung (bdrung) wrote :

Some tests were flaky because they contained race conditions. A dirty workaround (to not trigger the race conditions) applied in bionic was to sleep for 60 seconds. The race conditions were fixed in Apport recently and are part of the SRU for jammy.

Revision history for this message
Steve Langasek (vorlon) wrote : Proposed package upload rejected

An upload of apport to jammy-proposed has been rejected from the upload queue for the following reason: "contains bugfixes without bug references or test cases, does not meet SRU policy".

Revision history for this message
Benjamin Drung (bdrung) wrote :

The proper fix of the flaky tests were implemented in commit accf9969479fd39f28dc23dd1e6ec2aa06cc4303 ("tests: Fix GTK UI race condition and reduce timeout again") which is part of apport 2.21.0. Therefore the fix is in Ubuntu 22.10 (kinetic).

description: updated
summary: - Some tests are flaky due to timeout
+ Some GTK UI tests are flaky due to timeout
Benjamin Drung (bdrung)
Changed in apport:
status: New → Fix Released
importance: Undecided → Low
milestone: none → 2.21.0
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Didier, or anyone else affected,

Accepted apport into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apport/2.20.11-0ubuntu82.5 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in apport (Ubuntu Jammy):
status: New → Fix Committed
tags: added: verification-needed verification-needed-jammy
removed: verification-done
Revision history for this message
Benjamin Drung (bdrung) wrote :
tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.20.11-0ubuntu82.5

---------------
apport (2.20.11-0ubuntu82.5) jammy; urgency=medium

  * apport-gtk: Exclude trailing dot from URL links (LP: #1978301)
  * apport-bug: Add /snap/bin to PATH for Firefox snap on Lubuntu
    (LP: #1973470)
  * test:
    - Clear environment for test_run_as_real_user_no_sudo
    - Fix GTK UI tests if whoopsie.path is disabled
    - tests: Fix GTK UI race condition and reduce timeout again, saving
      five minutes test execution time (LP: #1780767)
    - tests: Fix race in tests for run_report_bug()

 -- Benjamin Drung <email address hidden> Fri, 14 Apr 2023 01:08:26 +0200

Changed in apport (Ubuntu Jammy):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.