Skip to content

increase waiting timeout from 5/10 to 30 seconds - #635

Merged
bdrung merged 2 commits into
canonical:mainfrom
bdrung:riscv64-timeout
Aug 3, 2026
Merged

increase waiting timeout from 5/10 to 30 seconds#635
bdrung merged 2 commits into
canonical:mainfrom
bdrung:riscv64-timeout

Conversation

@bdrung

@bdrung bdrung commented Jul 7, 2026

Copy link
Copy Markdown
Member

Some tests run into the waiting timeout on the slow and emulated riscv64 architecture, for example:

=================================== FAILURES ===================================
__________________________ T.test_crash_system_slice ___________________________

self = <tests.system.test_signal_crashes.T testMethod=test_crash_system_slice>

    @unittest.skipIf(
        get_init_system() != "systemd", "running init system is not systemd"
    )
    @skip_if_command_is_missing("systemd-run")
    @unittest.skipIf(os.geteuid() != 0, "this test needs to be run as root")
    def test_crash_system_slice(self) -> None:
        """Report generation for a protected process running in the system
        slice"""
        apport.fileutils.report_dir = self.orig_report_dir
        self.test_report = os.path.join(
            apport.fileutils.report_dir,
            f"{self.TEST_EXECUTABLE.replace('/', '_')}.{os.getuid()}.crash",
        )

        system_run = self.create_test_process(
            command="/usr/bin/systemd-run",
            args=[
                "-t",
                "-q",
                "--slice=system.slice",
                "-p",
                "ProtectSystem=true",
                self.TEST_EXECUTABLE,
            ]
            + self.TEST_ARGS,
        )
        try:
            sleep_pid = wait_for_process_to_appear(
                self.TEST_EXECUTABLE, self.running_test_executables
            )
            wait_for_sleeping_state(sleep_pid)
            os.kill(sleep_pid, signal.SIGSEGV)

>           self.wait_for_no_instance_running(self.TEST_EXECUTABLE)

/tmp/autopkgtest.RQrDHF/autopkgtest_tmp/tests/system/test_signal_crashes.py:261:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/tmp/autopkgtest.RQrDHF/autopkgtest_tmp/tests/system/test_signal_crashes.py:350: in wait_for_no_instance_running
    self.fail(f"Timeout exceeded, but {program} is still running.")
E   AssertionError: Timeout exceeded, but /usr/bin/gnusleep is still running.

So increase the waiting timeout from 5 and 10 seconds to 30 seconds.

There are multiple waiting functions but all have different conditions to wait for. Therefore is no easy way to unify them (while keeping them simple).

This PR should wait for #640 to land.

Bug: https://launchpad.net/bugs/2159030

@bdrung bdrung added the bug Something isn't working label Jul 7, 2026
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.49%. Comparing base (8a05b45) to head (5dbbcec).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #635   +/-   ##
=======================================
  Coverage   84.48%   84.49%           
=======================================
  Files         106      106           
  Lines       21014    21016    +2     
  Branches     3195     3195           
=======================================
+ Hits        17754    17757    +3     
  Misses       2785     2785           
+ Partials      475      474    -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bdrung
bdrung requested a review from Hyask July 29, 2026 12:39
bdrung added 2 commits August 3, 2026 12:32
Some tests run into the waiting timeout on the slow and emulated riscv64
architecture, for example:

```
=================================== FAILURES ===================================
__________________________ T.test_crash_system_slice ___________________________

self = <tests.system.test_signal_crashes.T testMethod=test_crash_system_slice>

    @unittest.skipIf(
        get_init_system() != "systemd", "running init system is not systemd"
    )
    @skip_if_command_is_missing("systemd-run")
    @unittest.skipIf(os.geteuid() != 0, "this test needs to be run as root")
    def test_crash_system_slice(self) -> None:
        """Report generation for a protected process running in the system
        slice"""
        apport.fileutils.report_dir = self.orig_report_dir
        self.test_report = os.path.join(
            apport.fileutils.report_dir,
            f"{self.TEST_EXECUTABLE.replace('/', '_')}.{os.getuid()}.crash",
        )

        system_run = self.create_test_process(
            command="/usr/bin/systemd-run",
            args=[
                "-t",
                "-q",
                "--slice=system.slice",
                "-p",
                "ProtectSystem=true",
                self.TEST_EXECUTABLE,
            ]
            + self.TEST_ARGS,
        )
        try:
            sleep_pid = wait_for_process_to_appear(
                self.TEST_EXECUTABLE, self.running_test_executables
            )
            wait_for_sleeping_state(sleep_pid)
            os.kill(sleep_pid, signal.SIGSEGV)

>           self.wait_for_no_instance_running(self.TEST_EXECUTABLE)

/tmp/autopkgtest.RQrDHF/autopkgtest_tmp/tests/system/test_signal_crashes.py:261:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/tmp/autopkgtest.RQrDHF/autopkgtest_tmp/tests/system/test_signal_crashes.py:350: in wait_for_no_instance_running
    self.fail(f"Timeout exceeded, but {program} is still running.")
E   AssertionError: Timeout exceeded, but /usr/bin/gnusleep is still running.
```

So increase the waiting timeout from 5 and 10 seconds to 30 seconds.

There are multiple waiting functions but all have different conditions
to wait for. Therefore is no easy way to unify them (while keeping them
simple).

Bug: https://launchpad.net/bugs/2159030
GitHub might be slow or the system might be slow (like riscv64) and
therefore a five seconds timeout might not be enough.

Bug: https://launchpad.net/bugs/2159030
@bdrung

bdrung commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

Rebased.

@bdrung
bdrung merged commit 5dbbcec into canonical:main Aug 3, 2026
75 of 78 checks passed
@bdrung
bdrung deleted the riscv64-timeout branch August 3, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants