Skip to content

[GIT PULL] Test: Introduce duration scale for upper timing bounds - #1634

Open
zeehha wants to merge 4 commits into
axboe:masterfrom
zeehha:user/cge/duration-scale
Open

[GIT PULL] Test: Introduce duration scale for upper timing bounds#1634
zeehha wants to merge 4 commits into
axboe:masterfrom
zeehha:user/cge/duration-scale

Conversation

@zeehha

@zeehha zeehha commented Sep 3, 2026

Copy link
Copy Markdown

Hey there,

as we run the tests on slower platforms like Qemu, we've introduced an environment variable LIBURING_DURATION_SCALE that specifies a factor to scale upper time bounds of tests where we ran into timing issues. A default factor of 1.0 is specified, so the timing of the tests stays as is.

I'm sending here a first patch set that introduces the test library function and the scaling for a few tests. We have a few more of these patches that we could follow up with.

Best,
Chris


git request-pull output:

The following changes since commit 4cf73437863c2e492d2a1d0f24330f391c0f075b:

  test/iowait.t: Skip if system is not quiesced for too long (2026-08-31 17:00:18 -0600)

are available in the Git repository at:

  https://github.com/zeehha/liburing user/cge/duration-scale

for you to fetch changes up to fd5bf3fa9fdc39f5d877f823b3bb475ad972502f:

  test/mshot-shutdown-race: Scale period of hang detection (2026-09-03 16:03:20 +0200)

----------------------------------------------------------------
Chris Gellermann (4):
      test: Introduce duration scale for upper timing bounds
      test/min-timeout-wait: Scale upper time bound
      test/io-wq-exit: Relax thread exit deadline
      test/mshot-shutdown-race: Scale period of hang detection

 test/helpers.c             | 27 +++++++++++++++++++++++++++
 test/helpers.h             |  2 ++
 test/io-wq-exit.c          |  2 +-
 test/min-timeout-wait.c    |  2 ++
 test/mshot-shutdown-race.c |  4 ++--
 test/runtests.sh           |  1 +

Click to show/hide pull request guidelines

Pull Request Guidelines

  1. To make everyone easily filter pull request from the email
    notification, use [GIT PULL] as a prefix in your PR title.
[GIT PULL] Your Pull Request Title
  1. Follow the commit message format rules below.
  2. Follow the Linux kernel coding style (see: https://github.com/torvalds/linux/blob/master/Documentation/process/coding-style.rst).

Commit message format rules:

  1. The first line is title (don't be more than 72 chars if possible).
  2. Then an empty line.
  3. Then a description (may be omitted for truly trivial changes).
  4. Then an empty line again (if it has a description).
  5. Then a Signed-off-by tag with your real name and email. For example:
Signed-off-by: Foo Bar <foo.bar@gmail.com>

The description should be word-wrapped at 72 chars. Some things should
not be word-wrapped. They may be some kind of quoted text - long
compiler error messages, oops reports, Link, etc. (things that have a
certain specific format).

Note that all of this goes in the commit message, not in the pull
request text. The pull request text should introduce what this pull
request does, and each commit message should explain the rationale for
why that particular change was made. The git tree is canonical source
of truth, not github.

Each patch should do one thing, and one thing only. If you find yourself
writing an explanation for why a patch is fixing multiple issues, that's
a good indication that the change should be split into separate patches.

If the commit is a fix for an issue, add a Fixes tag with the issue
URL.

Don't use GitHub anonymous email like this as the commit author:

123456789+username@users.noreply.github.com

Use a real email address!

Commit message example:

src/queue: don't flush SQ ring for new wait interface

If we have IORING_FEAT_EXT_ARG, then timeouts are done through the
syscall instead of by posting an internal timeout. This was done
to be both more efficient, but also to enable multi-threaded use
the wait side. If we touch the SQ state by flushing it, that isn't
safe without synchronization.

Fixes: https://github.com/axboe/liburing/issues/402
Signed-off-by: Jens Axboe <axboe@kernel.dk>

By submitting this pull request, I acknowledge that:

  1. I have followed the above pull request guidelines.
  2. I have the rights to submit this work under the same license.
  3. I agree to a Developer Certificate of Origin (see https://developercertificate.org for more information).

Chris Gellermann added 4 commits September 3, 2026 15:24
On slow platforms like Qemu, upper timing bounds may be exceeded.
Introduce a helper function to use an environment variable
'LIBURING_DURATION_SCALE' (specifying a float) for scaling the upper
timing boundaries. A default value of 1.0 is specified in the test
runner script leaving the current timing behavior unchanged.

Signed-off-by: Chris Gellermann <christian.gellermann@codasip.com>
The testcase min-timeout-wait checks for a variety of
io_uring_wait_cqes_min_timeout calls that the ellapsed time is within
the bounds min_t and max_t. Scale max_t (if LIBURING_DURATION_SCALE > 1)
to relax the timing on slow platforms.

Signed-off-by: Chris Gellermann <christian.gellermann@codasip.com>
Scale the upper timing expectation for the thread exit to account for
slow platforms.

Signed-off-by: Chris Gellermann <christian.gellermann@codasip.com>
Scale the period at which the signal handler to detect a hang runs to
account for slow platforms.

Signed-off-by: Chris Gellermann <christian.gellermann@codasip.com>
@krisman

krisman commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

I don't see a problem with this approach, but given that you need to touch the individual tests, I think it would also be fine and simpler to just increase the timeout of the failing tests, when confirmed the VM slowness it the real culprit for the failure. Either way, looks good.

One thing, IIRC, runtests also has a global timeout for the tests. does that fail as well? does it need to be scaled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants