Skip to content

Conversation

dmlloyd
Copy link
Member

@dmlloyd dmlloyd commented Jun 12, 2025

Convert most usages of the JDK ProcessBuilder and exec over to smallrye-common-process.

I've run across at least one class that can't be trivially converted because it is doing something complex/crazy/etc.; these cases should be refactored and cleaned up separately. I'll list these cases here as they appear, for future reference:

  • io.quarkus.test.common.DefaultDockerContainerLauncher
  • The general io.quarkus.test.common.ArtifactLauncher paradigm

Please review not just the code changes themselves, but also give feedback on the ergonomics of the process API in these various situations.

The move is split up into one commit per class so that we can bisect any problems that arise.

See #48223 for discussion and smallrye/smallrye-common#418 for the upstream PR.

@quarkus-bot quarkus-bot bot added area/arc Issue related to ARC (dependency injection) area/cli Related to quarkus cli (not maven/gradle/etc.) area/core area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle area/graphics area/grpc gRPC area/kubernetes area/maven area/metrics area/platform Issues related to definition and interaction with Quarkus Platform area/testing area/vertx labels Jun 12, 2025
Copy link

quarkus-bot bot commented Jun 12, 2025

/cc @Karm (awt), @brunobat (micrometer), @ebullient (micrometer), @galderz (awt)

@quarkus-bot quarkus-bot bot added the area/jbang Issues related to when using jbang.dev with Quarkus label Jun 12, 2025
@dmlloyd dmlloyd force-pushed the process branch 3 times, most recently from 84bf53d to b6442d5 Compare June 16, 2025 14:03
Copy link

github-actions bot commented Jun 16, 2025

🎊 PR Preview e8c4b6e has been successfully built and deployed to https://quarkus-pr-main-48354-preview.surge.sh/version/main/guides/

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

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

Very nice improvement!

@dmlloyd dmlloyd force-pushed the process branch 2 times, most recently from e608f01 to 9cc465f Compare June 23, 2025 19:09
@dmlloyd dmlloyd marked this pull request as ready for review June 25, 2025 18:38

This comment has been minimized.

@dmlloyd
Copy link
Member Author

dmlloyd commented Jul 10, 2025

Unfortunately, I have to push it again to resolve conflicts. But it should be OK to merge.

@geoand
Copy link
Contributor

geoand commented Jul 10, 2025

👍🏽

Let's merge when CI goes green

Copy link

quarkus-bot bot commented Jul 10, 2025

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit 6d95873.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Warning

There are other workflow runs running, you probably need to wait for their status before merging.

@dmlloyd dmlloyd merged commit c779b6d into quarkusio:main Jul 10, 2025
59 checks passed
@dmlloyd dmlloyd deleted the process branch July 10, 2025 19:36
@quarkus-bot quarkus-bot bot added this to the 3.25 - main milestone Jul 10, 2025
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Jul 10, 2025
Copy link

quarkus-bot bot commented Jul 10, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 6d95873.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.


Flaky tests - Develocity

⚙️ JVM Integration Tests - JDK 17

📦 integration-tests/kafka-devservices

io.quarkus.it.kafka.continuoustesting.DevServicesDevModeTest.testDevModeServiceDoesNotRestartContainersOnCodeChange - History

  • New containers: [Container(command=sh -c 'while [ ! -f /work/run.sh ]; do sleep 0.1; done; sleep 0.1; /work/run.sh', created=1752164880, id=60988c7e29ff72bf260b5b5e771e1b7077007b55d86c3216c2f576b9c5e0a72b, image=quay.io/ogunalp/kafka-native:latest, imageId=sha256:99fa71388449ac7ff46bda7f6d645fb4435d9a21dce3d4dbcaedfc8a738afd6b, names=[/sad_wilbur], ports=[ContainerPort(ip=0.0.0.0, privatePort=9092, publicPort=32857, type=tcp), ContainerPort(ip=::, privatePort=9092, publicPort=32857, type=tcp)], labels={architecture=x86_64, build-date=2025-03-25T21:45:00Z, com.redhat.component=ubi9-micro-container, com.redhat.license_terms=https://www.redhat.com/en/about/red-hat-end-user-license-agreements\#UBI, description=Very small image which doesn't install the package manager., distribution-scope=public, io.buildah.version=1.39.0-dev, io.k8s.description=Very small image which doesn't install the package manager., io.k8s.display-name=Red Hat Universal Base Image 9 Micro, io.openshift.expose-servi... - org.opentest4j.AssertionFailedError
org.opentest4j.AssertionFailedError: 
New containers: [Container(command=sh -c 'while [ ! -f /work/run.sh ]; do sleep 0.1; done; sleep 0.1; /work/run.sh', created=1752164880, id=60988c7e29ff72bf260b5b5e771e1b7077007b55d86c3216c2f576b9c5e0a72b, image=quay.io/ogunalp/kafka-native:latest, imageId=sha256:99fa71388449ac7ff46bda7f6d645fb4435d9a21dce3d4dbcaedfc8a738afd6b, names=[/sad_wilbur], ports=[ContainerPort(ip=0.0.0.0, privatePort=9092, publicPort=32857, type=tcp), ContainerPort(ip=::, privatePort=9092, publicPort=32857, type=tcp)], labels={architecture=x86_64, build-date=2025-03-25T21:45:00Z, com.redhat.component=ubi9-micro-container, com.redhat.license_terms=https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI, description=Very small image which doesn't install the package manager., distribution-scope=public, io.buildah.version=1.39.0-dev, io.k8s.description=Very small image which doesn't install the package manager., io.k8s.display-name=Red Hat Universal Base Im...

📦 integration-tests/opentelemetry-grpc-only

io.quarkus.it.opentelemetry.grpc.HelloGrpcClientTest.testHello - History

  • java.lang.RuntimeException: Failed to start quarkus - java.lang.RuntimeException
java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:668)
	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:763)
	at java.base/java.util.Optional.orElseGet(Optional.java:364)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
  • java.lang.RuntimeException: Failed to start quarkus - java.lang.RuntimeException
java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:668)
	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:763)
	at java.base/java.util.Optional.orElseGet(Optional.java:364)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)

⚙️ JVM Integration Tests - JDK 21

📦 integration-tests/kafka-devservices

io.quarkus.it.kafka.continuoustesting.DevServicesDevModeTest.testDevModeServiceDoesNotRestartContainersOnCodeChange - History

  • New containers: [Container(command=sh -c 'while [ ! -f /work/run.sh ]; do sleep 0.1; done; sleep 0.1; /work/run.sh', created=1752164872, id=20fd9d2ce39d182252cec83f7003f6c5df8a7d4d021ec4587ffa24289cac613a, image=quay.io/ogunalp/kafka-native:latest, imageId=sha256:99fa71388449ac7ff46bda7f6d645fb4435d9a21dce3d4dbcaedfc8a738afd6b, names=[/flamboyant_hermann], ports=[ContainerPort(ip=0.0.0.0, privatePort=9092, publicPort=32857, type=tcp), ContainerPort(ip=::, privatePort=9092, publicPort=32857, type=tcp)], labels={architecture=x86_64, build-date=2025-03-25T21:45:00Z, com.redhat.component=ubi9-micro-container, com.redhat.license_terms=https://www.redhat.com/en/about/red-hat-end-user-license-agreements\#UBI, description=Very small image which doesn't install the package manager., distribution-scope=public, io.buildah.version=1.39.0-dev, io.k8s.description=Very small image which doesn't install the package manager., io.k8s.display-name=Red Hat Universal Base Image 9 Micro, io.openshift.expo... - org.opentest4j.AssertionFailedError
org.opentest4j.AssertionFailedError: 
New containers: [Container(command=sh -c 'while [ ! -f /work/run.sh ]; do sleep 0.1; done; sleep 0.1; /work/run.sh', created=1752164872, id=20fd9d2ce39d182252cec83f7003f6c5df8a7d4d021ec4587ffa24289cac613a, image=quay.io/ogunalp/kafka-native:latest, imageId=sha256:99fa71388449ac7ff46bda7f6d645fb4435d9a21dce3d4dbcaedfc8a738afd6b, names=[/flamboyant_hermann], ports=[ContainerPort(ip=0.0.0.0, privatePort=9092, publicPort=32857, type=tcp), ContainerPort(ip=::, privatePort=9092, publicPort=32857, type=tcp)], labels={architecture=x86_64, build-date=2025-03-25T21:45:00Z, com.redhat.component=ubi9-micro-container, com.redhat.license_terms=https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI, description=Very small image which doesn't install the package manager., distribution-scope=public, io.buildah.version=1.39.0-dev, io.k8s.description=Very small image which doesn't install the package manager., io.k8s.display-name=Red Hat Universal...

@rsvoboda
Copy link
Member

Just for the record, this slightly changes the output generated by ComposeRunner:

3.24.4:
Screenshot 2025-07-22 at 9 25 04

3.25.0.CR1:
Screenshot 2025-07-22 at 9 24 40

@dmlloyd
Copy link
Member Author

dmlloyd commented Jul 22, 2025

Any case where the process is normally writing to stderr, where it is not an error, should have error().logOnSuccess(false).

In this particular case, we had previously set the error stream to be redirected to output. I don't think that's the right thing here, so I'd say that this code should be changed to just log the stderr at INFO level like before.

I'll put up a PR for that.

@dmlloyd
Copy link
Member Author

dmlloyd commented Jul 22, 2025

Created #49043.

Eng-Fouad added a commit to Eng-Fouad/quarkus that referenced this pull request Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection) area/cli Related to quarkus cli (not maven/gradle/etc.) area/core area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle area/graphics area/grpc gRPC area/jbang Issues related to when using jbang.dev with Quarkus area/kubernetes area/maven area/metrics area/platform Issues related to definition and interaction with Quarkus Platform area/testing area/vertx triage/flaky-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants