Skip to content

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

Open
bdrung wants to merge 2 commits into
canonical:mainfrom
bdrung:riscv64-timeout
Open

increase waiting timeout from 5/10 to 30 seconds#635
bdrung wants to merge 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).

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

bdrung added 2 commits July 7, 2026 11:17
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 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.46%. Comparing base (d9d3c9f) to head (6ead4e5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #635      +/-   ##
==========================================
- Coverage   84.47%   84.46%   -0.01%     
==========================================
  Files         106      106              
  Lines       21053    21055       +2     
  Branches     3223     3223              
==========================================
+ Hits        17784    17785       +1     
- Misses       2792     2793       +1     
  Partials      477      477              

☔ 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.

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.

1 participant