Skip to content

[fix][build] Restore Maven-era async-profiler wiring for integration test images#26147

Open
void-ptr974 wants to merge 1 commit into
apache:masterfrom
void-ptr974:restore-gradle-async-profiler
Open

[fix][build] Restore Maven-era async-profiler wiring for integration test images#26147
void-ptr974 wants to merge 1 commit into
apache:masterfrom
void-ptr974:restore-gradle-async-profiler

Conversation

@void-ptr974

@void-ptr974 void-ptr974 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Motivation

PulsarProfilingTest supports profiling broker-side workloads with async-profiler. This support existed in the Maven-based workflow, where the build could install async-profiler into the test images and pass the profiler options to the integration test JVM.

After the Gradle migration, the same async-profiler wiring was no longer available through the Gradle build. This PR backports the Maven-era async-profiler wiring to Gradle. It does not introduce a new profiling mode; it restores the existing profiling workflow for the Gradle build.

Modifications

  • Ported the Maven-era docker.install.asyncprofiler option to :tests:java-test-image:dockerBuild.
  • Ported the Maven-era docker.install.asyncprofiler option to :tests:latest-version-image:dockerBuild.
  • Updated the async-profiler installed into the test images to 4.4.
  • Ported the Maven-era integration test profiler properties to the integrationTest JVM:
    • inttest.asyncprofiler.dir
    • inttest.asyncprofiler.opts
    • inttest.asyncprofiler.outputformat
    • git.commit.id.abbrev
    • build.timestamp
  • Kept the existing PulsarContainer defaults for optional profiler settings when the matching Gradle properties are not provided.
  • Updated PulsarProfilingTest usage comments to use the Gradle Docker image build task and --tests.

Usage

Build the test image with async-profiler installed:

./gradlew :tests:java-test-image:dockerBuild \
  -Pdocker.install.asyncprofiler=true \
  -Pdocker.wolfi

Run the profiling integration test:

export PULSAR_TEST_IMAGE_NAME=apachepulsar/java-test-image:latest
export ENABLE_MANUAL_TEST=true
export NETTY_LEAK_DETECTION=off

./gradlew :tests:integration:integrationTest \
  --tests org.apache.pulsar.tests.integration.profiling.PulsarProfilingTest \
  -PtestRetryCount=0 \
  -Pinttest.asyncprofiler.dir=/tmp/pulsar-profiles \
  -Pinttest.asyncprofiler.outputformat=jfr

The profiler output is written to the directory configured by inttest.asyncprofiler.dir.

Verifying this change

  • Make sure that the change passes the CI checks.

This change can be verified with the existing profiling integration test workflow:

  • ./gradlew :tests:integration:compileTestJava :tests:integration:checkstyleTest --no-configuration-cache
  • ./gradlew :tests:java-test-image:dockerBuild -Pdocker.install.asyncprofiler=true -Pdocker.wolfi
  • ./gradlew :tests:latest-version-image:dockerBuild -Pdocker.install.asyncprofiler=true -Pdocker.wolfi
  • Verified that explicitly provided profiler Gradle properties are passed to the integrationTest JVM.
  • Verified that both generated test images contain async-profiler 4.4.
  • Verified that PulsarProfilingTest.runPulsarPerf passes with ENABLE_MANUAL_TEST=true.
  • Verified that the broker JVM starts with the async-profiler -agentpath option.
  • Verified that the test generates a non-empty .jfr file readable by jfr summary.

Does this pull request potentially affect one of the following parts:

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

@void-ptr974 void-ptr974 changed the title [fix][build] Restore async-profiler wiring for integration test images [fix][build] Restore Maven-era async-profiler wiring for integration test images Jul 4, 2026
@void-ptr974 void-ptr974 force-pushed the restore-gradle-async-profiler branch from 6a1934f to e7ceff2 Compare July 4, 2026 07:35
@lhotari

lhotari commented Jul 4, 2026

Copy link
Copy Markdown
Member

Verified that both generated test images contain async-profiler 4.1.

async-profiler should be upgraded to 4.4 version
https://github.com/async-profiler/async-profiler/releases/tag/v4.4

@void-ptr974 void-ptr974 force-pushed the restore-gradle-async-profiler branch from e7ceff2 to a3973be Compare July 5, 2026 02:56
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.

2 participants