HomeFreeBSD

limits tests: Try to fix spurious cputime test failures

Description

limits tests: Try to fix spurious cputime test failures

I very occasionally see test failures caused by the total CPU time being
several milliseconds under 3s. The test runs "limits -t 3 time <busy
loop>" and verifies that the reported time elapsed is at least 3s (and
not too much more). In particular, any time spent executing time(1)
itself is counted against the limit but not recorded in the output.

I think it makes more sense to reverse the order, so that the CPU time
limit is not applied to time(1) itself. This also resolves the test
failures I was seeing, which were reproducible only under load (i.e.,
running many tests in parallel).

MFC after: 2 weeks
Sponsored by: Klara, Inc.

Details

Provenance
markjAuthored on Feb 14 2025, 4:26 PM
Parents
rG36631977d8c9: ktr: Use STAILQ_EMPTY_ATOMIC when checking for records in ktr_drain()
Branches
Unknown
Tags
Unknown