Skip to content

[AUTO] RHEL-141678 - aide multi-threading performance regression#56

Open
Koncpa wants to merge 3 commits into
masterfrom
auto/RHEL-141678_test
Open

[AUTO] RHEL-141678 - aide multi-threading performance regression#56
Koncpa wants to merge 3 commits into
masterfrom
auto/RHEL-141678_test

Conversation

@Koncpa

@Koncpa Koncpa commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

This PR was generated by the QE automation pipeline and requires human review.

Summary

This PR introduces a new regression test for RHEL-141678, which addresses a performance degradation in aide when using its default multi-threading capabilities.

Test Description

The new test, located at Regression/RHEL-141678-aide-threading-performance, measures and compares the execution time of aide --init with and without multi-threading enabled (-W 0 flag).

The test fails if the multi-threaded execution is more than 20% slower than the single-threaded execution, thus preventing future performance regressions of this nature.

How to Run

  1. Provision a RHEL 10.3 or later machine.
  2. Install aide and beakerlib.
  3. Execute the test using rhts-run.sh or tmt.

Reference Tests

  • Sanity/aide-db-update-and-compare

Summary by Sourcery

Tests:

  • Introduce a beakerlib-based regression test that compares aide --init execution time with and without multi-threading and fails if multi-threading is over 20% slower.

@sourcery-ai

sourcery-ai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a new beakerlib-based regression test that measures AIDE initialization performance with and without multi-threading and fails if multi-threading is more than 20% slower, guarding against the RHEL-141678 regression.

File-Level Changes

Change Details Files
Introduce a beakerlib regression test that times aide --init with and without multi-threading and enforces a 20% performance regression threshold.
  • Create a new beakerlib runtest script that sets up a temporary directory, copies and adjusts aide.conf to use local gzip database files, and runs aide --init in both multi-threaded and single-threaded modes while timing via the SECONDS shell variable.
  • Implement integer-arithmetic comparison logic that computes an allowed multi-threaded runtime as 120% of the single-threaded runtime and fails the test if the multi-threaded run exceeds this bound, logging detailed timing and pass/fail messages via beakerlib.
  • Add accompanying test metadata and placeholder files (PURPOSE, main.fmf) for the new Regression/RHEL-141678-aide-threading-performance test case.
Regression/RHEL-141678-aide-threading-performance/runtest.sh
Regression/RHEL-141678-aide-threading-performance/PURPOSE
Regression/RHEL-141678-aide-threading-performance/main.fmf

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 found 1 issue, and left some high level feedback:

  • The timing variables multithread_time and singlethread_time are assigned inside rlRun commands, which execute in a subshell, so those variable values will not persist in the main script and the subsequent comparison logic will not work as intended; consider measuring time outside rlRun or capturing it via command substitution.
  • Using SECONDS with a single run of aide --init may lead to very coarse or noisy measurements on fast systems; consider running each configuration multiple times and comparing a min/average to reduce flakiness in the 20% threshold check.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The timing variables `multithread_time` and `singlethread_time` are assigned inside `rlRun` commands, which execute in a subshell, so those variable values will not persist in the main script and the subsequent comparison logic will not work as intended; consider measuring time outside `rlRun` or capturing it via command substitution.
- Using `SECONDS` with a single run of `aide --init` may lead to very coarse or noisy measurements on fast systems; consider running each configuration multiple times and comparing a min/average to reduce flakiness in the 20% threshold check.

## Individual Comments

### Comment 1
<location path="Regression/RHEL-141678-aide-threading-performance/runtest.sh" line_range="16-21" />
<code_context>
+
+    rlPhaseStartTest "Test AIDE performance with and without multi-threading"
+        # Time the execution of "aide --init" with default multi-threading
+        rlRun "SECONDS=0; aide --init -c aide.conf; multithread_time=\$SECONDS" "Running aide --init with multi-threading"
+        rlLog "Multi-threaded execution time: \$multithread_time seconds"
+        rlRun "rm -f aide.db.new.gz"
+
+        # Time the execution of "aide --init" with multi-threading disabled
+        rlRun "SECONDS=0; aide --init -c aide.conf -W 0; singlethread_time=\$SECONDS" "Running aide --init without multi-threading"
+        rlLog "Single-threaded execution time: \$singlethread_time seconds"
+
</code_context>
<issue_to_address>
**issue (bug_risk):** rlRun arguments are misordered, so the description strings are being treated as expected return codes.

`rlRun` has the form `rlRun COMMAND [EXPECT_RET=0 [MESSAGE ...]]`. Here the second argument is being used for the message, so the string is actually parsed as `EXPECT_RET` (coerced to `0`) and the message is lost. Please make the expected return code explicit and move the descriptions to the third argument, e.g.:

```bash
rlRun "SECONDS=0; aide --init -c aide.conf; multithread_time=$SECONDS" 0 "Running aide --init with multi-threading"
rlRun "SECONDS=0; aide --init -c aide.conf -W 0; singlethread_time=$SECONDS" 0 "Running aide --init without multi-threading"
```
</issue_to_address>

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.

Comment on lines +16 to +21
rlRun "SECONDS=0; aide --init -c aide.conf; multithread_time=\$SECONDS" "Running aide --init with multi-threading"
rlLog "Multi-threaded execution time: \$multithread_time seconds"
rlRun "rm -f aide.db.new.gz"

# Time the execution of "aide --init" with multi-threading disabled
rlRun "SECONDS=0; aide --init -c aide.conf -W 0; singlethread_time=\$SECONDS" "Running aide --init without multi-threading"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): rlRun arguments are misordered, so the description strings are being treated as expected return codes.

rlRun has the form rlRun COMMAND [EXPECT_RET=0 [MESSAGE ...]]. Here the second argument is being used for the message, so the string is actually parsed as EXPECT_RET (coerced to 0) and the message is lost. Please make the expected return code explicit and move the descriptions to the third argument, e.g.:

rlRun "SECONDS=0; aide --init -c aide.conf; multithread_time=$SECONDS" 0 "Running aide --init with multi-threading"
rlRun "SECONDS=0; aide --init -c aide.conf -W 0; singlethread_time=$SECONDS" 0 "Running aide --init without multi-threading"

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