davsclaus commented on code in PR #27909:
URL: https://github.com/apache/camel/pull/27909#discussion_r4286266987
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelMemoryLeak.java:
##########
@@ -139,38 +139,38 @@ private int doDualRecording(long pid) throws Exception {
printer().printf("Recording 1 of 2 (%ds)...%n", dur1);
JsonObject startResp = sendAction(pid, "start", dur1);
if (startResp == null ||
!"recording".equals(startResp.getString("status"))) {
- printer().println("Error: Failed to start recording 1");
+ printer().printErr("Failed to start recording 1");
return 1;
Review Comment:
Fixed in f7ba1c632a2d: `doDualRecording` and `handleResponse` return
`CliExitCode.FAILURE`, and `doCall()` now prints `ERROR: No running Camel
integration matches: <name>` on stderr and exits with 3 (`NOT_FOUND`) when
nothing matches. When more than one integration matches it also exits with 3,
with the message on stderr instead of stdout.
`ExitCodeContractTest.noMatchingIntegrationIsNotFound` covers the no-match case.
_Claude Code on behalf of davsclaus_
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelMemoryLeak.java:
##########
@@ -139,38 +139,38 @@ private int doDualRecording(long pid) throws Exception {
printer().printf("Recording 1 of 2 (%ds)...%n", dur1);
JsonObject startResp = sendAction(pid, "start", dur1);
if (startResp == null ||
!"recording".equals(startResp.getString("status"))) {
- printer().println("Error: Failed to start recording 1");
+ printer().printErr("Failed to start recording 1");
return 1;
}
waitForRecordingComplete(pid, dur1);
JsonObject stopResp = sendAction(pid, "stop", 0);
if (stopResp == null ||
!"completed".equals(stopResp.getString("status"))) {
- printer().println("Error: Recording 1 did not complete");
+ printer().printErr("Recording 1 did not complete");
return 1;
}
// run 2
printer().printf("Recording 2 of 2 (%ds)...%n", dur2);
startResp = sendAction(pid, "start", dur2);
if (startResp == null ||
!"recording".equals(startResp.getString("status"))) {
- printer().println("Error: Failed to start recording 2");
+ printer().printErr("Failed to start recording 2");
return 1;
}
waitForRecordingComplete(pid, dur2);
stopResp = sendAction(pid, "stop", 0);
if (stopResp == null ||
!"completed".equals(stopResp.getString("status"))) {
- printer().println("Error: Recording 2 did not complete");
+ printer().printErr("Recording 2 did not complete");
return 1;
}
// compare
JsonObject cmpResp = sendAction(pid, "compare", 0);
if (cmpResp == null) {
- printer().println("Error: Failed to get comparison data");
+ printer().printErr("Failed to get comparison data");
return 1;
Review Comment:
Fixed in f7ba1c632a2d: no reply now exits with 124 (`TIMEOUT`). That covers
`doCall()`, whose message moved to stderr, and each step of the dual recording
(start, stop, compare), through a small `noReply` helper. A reply with an
unexpected status stays 1 (`FAILURE`), since the integration did answer.
_Claude Code on behalf of davsclaus_
--
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]