void-ptr974 opened a new pull request, #26147:
URL: https://github.com/apache/pulsar/pull/26147
### Motivation
`PulsarProfilingTest` supports profiling broker-side workloads with
async-profiler, but the Gradle build did not pass the async-profiler related
options through the full test path.
This prevented the Gradle-based workflow from building test images with
async-profiler installed and from passing the integration test profiler options
to the Test JVM.
### Modifications
- Added `-Pdocker.install.asyncprofiler=true` support to
`:tests:java-test-image:dockerBuild`.
- Added `-Pdocker.install.asyncprofiler=true` support to
`:tests:latest-version-image:dockerBuild`.
- Passed the following Gradle properties to the `integrationTest` JVM:
- `inttest.asyncprofiler.dir`
- `inttest.asyncprofiler.opts`
- `inttest.asyncprofiler.outputformat`
- `git.commit.id.abbrev`
- `build.timestamp`
- Updated `PulsarProfilingTest` usage comments to use the Gradle Docker
image build task and `--tests`.
### Usage
Build the test image with async-profiler installed:
```bash
./gradlew :tests:java-test-image:dockerBuild \
-Pdocker.install.asyncprofiler=true \
-Pdocker.wolfi
```
Run the profiling integration test:
```bash
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
- [x] Make sure that the change passes the CI checks.
This change is already covered by existing integration test infrastructure
and was verified as follows:
- `./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 both generated test images contain async-profiler 4.1.
- 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]