Skip to content

[improve][test] Add filtering solution for fast selection of TestNG groups#24921

Draft
lhotari wants to merge 3 commits intoapache:masterfrom
lhotari:lh-testng-filter
Draft

[improve][test] Add filtering solution for fast selection of TestNG groups#24921
lhotari wants to merge 3 commits intoapache:masterfrom
lhotari:lh-testng-filter

Conversation

@lhotari
Copy link
Copy Markdown
Member

@lhotari lhotari commented Oct 30, 2025

Motivation

When executing tests with Surefire & TestNG, there's a lot of overhead caused by the test filtering. It takes 1-2 seconds to evaluate whether each test class belongs to the test group since TestNG instantiates each test class, runs configured listeners and then decides whether the class belongs to the test group.
Since there's a lot of test classes in pulsar-broker, a lot of unnecessary time is spent in each broker group test job just to filter out tests.

This solution will reduce the duration of each test job and allow further splitting of pulsar-broker tests to be run in separate test jobs in CI.

Modifications

  • add a utility class for test filtering using Byte-buddy directly at the byte code level
  • add maven profiles for filtering and test execution
  • adapt build/run_unit_group.sh script to use the test filtering solution

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@lhotari lhotari added this to the 4.2.0 milestone Oct 30, 2025
@lhotari lhotari self-assigned this Oct 30, 2025
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Oct 30, 2025
@lhotari
Copy link
Copy Markdown
Member Author

lhotari commented Oct 30, 2025

/pulsarbot rerun-failure-checks

@lhotari lhotari marked this pull request as draft October 30, 2025 12:35
@lhotari
Copy link
Copy Markdown
Member Author

lhotari commented Oct 30, 2025

There's a difference in the number of executed tests for some reason. Would have to check further to find out the difference.

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

Labels

doc-not-needed Your PR changes do not impact docs ready-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant