Deflake TestMultiContainerEvent/enableCgroupsV2 - #14045
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
test/cl961130333
branch
4 times, most recently
from
August 8, 2026 01:51
fb1eefb to
8637ff7
Compare
The test asserted that the exited "quick" container (/bin/true) reports non-zero CPU usage via cgroup v2 cpu.stat. The cgroup2fs charging is correct (exit charges are committed before the parent can reap), but the sentry accounts task CPU time in whole 10ms clock ticks: a task that is never running when the ticker fires accrues zero time. A container as short-lived as /bin/true misses every tick in a few percent of runs, making the assertion flaky. Linux never reports 0 here only because it accounts at nanosecond granularity. Make the quick container burn a short burst of CPU before exiting so that several tick boundaries land while it runs, which makes the accumulated usage reliably non-zero. The v1 and disabled-cgroups subtests are unaffected: the v1 events path keys ContainerUsage by container name rather than ID, and the sentry fallback only counts live thread groups, so both still report 0 for the exited container. PiperOrigin-RevId: 961224935
copybara-service
Bot
force-pushed
the
test/cl961130333
branch
from
August 8, 2026 01:56
8637ff7 to
5ceb9a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deflake TestMultiContainerEvent/enableCgroupsV2
The test asserted that the exited "quick" container (/bin/true) reports
non-zero CPU usage via cgroup v2 cpu.stat. The cgroup2fs charging is
correct (exit charges are committed before the parent can reap), but
the sentry accounts task CPU time in whole 10ms clock ticks: a task
that is never running when the ticker fires accrues zero time. A
container as short-lived as /bin/true misses every tick in a few
percent of runs, making the assertion flaky.
Linux never reports 0 here only because it accounts at nanosecond
granularity.
Make the quick container burn a short burst of CPU before exiting so
that several tick boundaries land while it runs, which makes the
accumulated usage reliably non-zero. The v1 and disabled-cgroups
subtests are unaffected: the v1 events path keys ContainerUsage by
container name rather than ID, and the sentry fallback only counts
live thread groups, so both still report 0 for the exited container.