~apport-hackers/apport/main

Viewing all changes in revision 3569.

  • Committer: Benjamin Drung
  • Date: 2022-07-01 13:58:34 UTC
  • Revision ID: git-v1:970a8028b89c07d10f187345e7cce7ebd162ab54
tests: Fix killing test executable too early

The `test_core_dump_packaged` test from Apport 2.22.0 is flaky on
`arm64` and `ppc64el`. It fails sometimes with AssertionError: '\n#2'
not found in '#0 0x0000fffff7fd9c00 in ?? ()\nNo symbol table info
available.\nBacktrace stopped: not enough registers or memory available
to unwind further'.

This GDB backtrace is caused by killing the test executable before it
started. When waiting for the test executable to appear as GDB child
process, wait until the process status is not `tracing-stop` any more.

The test executable in `test_leak_inaccessible_files` changes its
cmdline and `psutil.Process.name()` will not return the correct
command name any more. Change `wait_for_gdb_child_process` to check the
first element of `psutil.Process.cmdline()` instead. This also ensures
that the test executable is killed after its cmdline change. Therefore
the sleep is not needed any more since the potential race condition is
fixed.

Bug: https://launchpad.net/bugs/1980390
Signed-off-by: Benjamin Drung <bdrung@ubuntu.com>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: