gnodet-bot commented on code in PR #29517:
URL: https://github.com/apache/camel/pull/29517#discussion_r4518377211
##########
components/camel-chaos/src/main/java/org/apache/camel/component/chaos/ChaosExperiment.java:
##########
@@ -168,8 +194,20 @@ private JsonObject read(
jo.put("ruleTexts", texts);
jo.put("faults", faults);
jo.put("expectations", expectations);
- jo.put("verdict", unmet ? FAIL : !undecided ? PASS : ended ?
INCONCLUSIVE : PENDING);
+ if (lost > 0) {
+ jo.put("lostAtDeadLetterChannel", lost);
+ jo.put("lostAtDeadLetterChannelPerRule", lostAtDlq);
+ }
+ // nothing fired: the expectations were not put to the test (an unmet
one is still a FAIL, with its evidence)
+ boolean neverFired = firedAll == 0;
+ String verdict = unmet || lost > 0
+ ? FAIL : !undecided && !neverFired ? PASS : ended ?
INCONCLUSIVE : PENDING;
+ jo.put("verdict", verdict);
+ if (INCONCLUSIVE.equals(verdict)) {
+ jo.put("reason", neverFired ? NEVER_FIRED : NOT_DECIDED);
Review Comment:
💡 When both `neverFired` and `undecided` are true, `NEVER_FIRED` takes
priority (correct semantically — if faults never fired, that's the more
fundamental reason). A short comment like `// neverFired takes priority: if
faults never ran, undecided is a consequence, not the cause` would help future
readers.
##########
components/camel-chaos/src/main/java/org/apache/camel/component/chaos/ChaosExperiment.java:
##########
@@ -168,8 +194,20 @@ private JsonObject read(
jo.put("ruleTexts", texts);
jo.put("faults", faults);
jo.put("expectations", expectations);
- jo.put("verdict", unmet ? FAIL : !undecided ? PASS : ended ?
INCONCLUSIVE : PENDING);
+ if (lost > 0) {
+ jo.put("lostAtDeadLetterChannel", lost);
+ jo.put("lostAtDeadLetterChannelPerRule", lostAtDlq);
+ }
+ // nothing fired: the expectations were not put to the test (an unmet
one is still a FAIL, with its evidence)
+ boolean neverFired = firedAll == 0;
Review Comment:
💡 `firedAll` accumulates across all rules in the loop — so `neverFired` is
`true` only when every rule fired zero times. In a multi-rule experiment, if
rule A fires but rule B doesn't, `neverFired` is `false` even though B's faults
had no opportunity to exercise B's expectations. Worth a brief comment if
per-rule "never fired" semantics are ever needed.
--
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]