Skip to content

Fix flaky --max-workers strace assertion on aarch64#1102

Merged
kkaarreell merged 2 commits into
rhel-9-mainfrom
backport/20260722134729_rhel-9-main
Jul 23, 2026
Merged

Fix flaky --max-workers strace assertion on aarch64#1102
kkaarreell merged 2 commits into
rhel-9-mainfrom
backport/20260722134729_rhel-9-main

Conversation

@kkaarreell

@kkaarreell kkaarreell commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Count only process forks (SIGCHLD) from the main keylime-policy PID instead of all clone/clone3 lines, filtering out non-deterministic thread creation in child processes. Also widen the gap by comparing --max-workers 1 vs 5 (difference of 4 forks) instead of 1 vs 3 (difference of 2).

Summary by Sourcery

Stabilize the keylime-policy --max-workers functional test by making the strace-based worker count deterministic and adjusting the comparison to a larger worker difference.

Bug Fixes:

  • Prevent flaky assertion in the --max-workers strace test on aarch64 by filtering out non-deterministic thread clones and widening the worker count gap.

Tests:

  • Update the strace-based worker counting in keylime-policy functional tests to count only SIGCHLD process forks from the main process and compare --max-workers 1 vs 5.

@kkaarreell kkaarreell self-assigned this Jul 22, 2026
@sourcery-ai

sourcery-ai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The test for keylime-policy --max-workers has been made more deterministic and robust by counting only process forks from the main keylime-policy PID in strace output and widening the worker count comparison from 1 vs 3 to 1 vs 5.

File-Level Changes

Change Details Files
Make the strace-based --max-workers test deterministic by filtering clone events to the main process and comparing 1 vs 5 workers instead of 1 vs 3.
  • Change the second strace invocation to use --max-workers 5 and write to strace_5.log instead of using 3 workers and strace_3.log.
  • Extract the main keylime-policy PID from the first line of each strace log using awk and store as MAIN_PID_1 and MAIN_PID_5.
  • Count clone events only for the main PID where the clone leads to SIGCHLD, avoiding nondeterministic thread clones in child processes.
  • Update log messages to reference clone counts for --max-workers 1 and 5 instead of 1 and 3.
  • Update the final assertion to compare CLONES_1 and CLONES_5, ensuring fewer workers with --max-workers 1 than with 5.
functional/keylime-policy-commands/test.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

kkaarreell and others added 2 commits July 23, 2026 08:37
Count only process forks (SIGCHLD) from the main keylime-policy PID
instead of all clone/clone3 lines, filtering out non-deterministic
thread creation in child processes. Also widen the gap by comparing
--max-workers 1 vs 5 (difference of 4 forks) instead of 1 vs 3
(difference of 2).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ting

The strace approach to verify --max-workers was architecture-dependent:
clone syscall output format differs between x86_64 and aarch64, causing
false negatives. Instead, use a stalling HTTP server that serves repodata
normally but holds RPM download connections open, then count established
TCP connections with ss to verify worker parallelism.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kkaarreell
kkaarreell force-pushed the backport/20260722134729_rhel-9-main branch from cd1db39 to c313f5c Compare July 23, 2026 06:38
@kkaarreell
kkaarreell merged commit 1ddab8e into rhel-9-main Jul 23, 2026
5 checks passed
@kkaarreell
kkaarreell deleted the backport/20260722134729_rhel-9-main branch July 23, 2026 10:23
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.

1 participant