tests/integration/test_hookutils.py::T::test_recent_syslog fails on s390x

Bug #2073935 reported by Benjamin Drung
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Apport
Fix Released
Medium
Unassigned
apport (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The Apport 2.29.0 test case `tests/integration/test_hookutils.py::T::test_recent_syslog` fails on s390x:

```
349s =================================== FAILURES ===================================
349s _____________________________ T.test_recent_syslog _____________________________
349s
349s self = <tests.integration.test_hookutils.T testMethod=test_recent_syslog>
349s
349s def test_recent_syslog(self):
349s """recent_syslog"""
349s self.assertEqual(
349s apport.hookutils.recent_syslog(re.compile("."), path="/nonexisting"), ""
349s )
349s self.assertEqual(
349s apport.hookutils.recent_syslog(re.compile("ThisCantPossiblyHitAnything")),
349s "",
349s )
349s if os.path.exists("/run/systemd/system") or os.access(
349s "/var/log/syslog", os.R_OK
349s ):
349s > self.assertNotEqual(len(apport.hookutils.recent_syslog(re.compile("."))), 0)
349s E AssertionError: 0 == 0
349s
349s tests/integration/test_hookutils.py:208: AssertionError
349s ----------------------------- Captured stderr call -----------------------------
349s tail: cannot open '/nonexisting' for reading: No such file or directory
```

Full log: https://autopkgtest.ubuntu.com/results/autopkgtest-oracular/oracular/s390x/a/apport/20240722_004756_30d6c@/log.gz

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

In my PPA autopkgtest run, this failure happened every time as well.

Benjamin Drung (bdrung)
Changed in apport:
milestone: none → 2.30.0
importance: Undecided → Medium
Revision history for this message
Chris Peterson (cpete) wrote :

I'm pretty sure I've figured out the root cause. The recent_syslog hookutil wasn't emptying the stdout buffer after the process completed and the python code was racing to get to the poll loop before the process finished.

See: https://github.com/canonical/apport/pull/382

Revision history for this message
Benjamin Drung (bdrung) wrote :
Changed in apport:
status: New → Fix Committed
Benjamin Drung (bdrung)
Changed in apport:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.30.0-0ubuntu1

---------------
apport (2.30.0-0ubuntu1) oracular; urgency=medium

  [ Benjamin Drung ]
  * New upstream release:
    - whoopsie-upload-all: exit with 0 if whoopsie is disabled (LP: #2069360)
    - launchpad: don't systematically order retrace on private reports
      (LP: #2068933)
    - recent-syslog: read stdout after process completion (LP: #2073935)
    - Fix apport-retrace system tests on non-amd64 (LP: #2069815)
    - fix race condition in wait_for_gdb_sleeping_child_process (LP: #2073933)
    - fix flaky test_crash_system_slice (LP: #2076186)
  * Depend on gdb-multiarch and python3-psutil for system tests

  [ Chris Peterson ]
  * subiquity: handle missing log for version inspect (LP: #2067775)

  [ Sebastien Bacher ]
  * Fix some issues in the hook for ubuntu-desktop-bootstrap (LP: #2072751)

 -- Benjamin Drung <email address hidden> Fri, 09 Aug 2024 16:57:32 +0200

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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