Skip to content

CAMEL-26699: camel-jbang - chaos screen: poll targets, pick order, expectation count, effect of delays and polls - #29358

Merged
davsclaus merged 1 commit into
mainfrom
CAMEL-26699-chaos-screen-findings
Nov 6, 2026
Merged

davsclaus merged 1 commit into
mainfrom
CAMEL-26699-chaos-screen-findings

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

CAMEL-26699: fixes for what a hands-on round of the chaos screen turned up, using a small demo shop.

camel-chaos

  • An expectation keeps counting after it is decided, until its time is up. The outcome still never changes once decided (by design). Before, expect=orders:handled<=0 stayed at "1 handled" while the rule's effect and the route counts said 6. Now the reason says "6 exchanges handled ..., at most 0 expected". lost is unaffected: it only reads the count of an unmet completed expectation, which was never decided early.

Terminal UI, chaos screen

  • Poll targets: "Polls fail" / "Polls are skipped" and ! offer only consumers that poll on a schedule. The consumers console marks a timer scheduled as well, but at=poll hooks only a scheduled poll consumer, which is the one that has a schedulerClass. The rule check already warned about a timer; the form no longer offers it.
  • Pick order: the endpoints are offered as remote calls first, then the sends within the integration, then the endpoints only an error handler sends to. The dead letter channel came first before, and now comes last: it has a producer in every route but no out endpoint, and it has a recipe of its own. The reply side of platform-http (an out endpoint that a route consumes) is no longer offered as a send.
  • FAULT is shown in a few words, as the report says it: error status 503, error ConnectException, delay 300ms..800ms, stop 5s ×3 every 20s. A flapping rule was cut to lifecycle action=stop duration=5. The full rule stays in the title of the detail panel.
  • EFFECT: the in-flight mark is now ◷ instead of …, because 62↩ 1… read like cut text. The column is as wide as its counts need.
  • Poll rules show their effect: 12 polls failed in the table, and in the detail "12 polls failed: the consumer polls again on its schedule". Before, it was empty.
  • What a delay costs: the detail lists the routes of the rule's recent faults with their mean, p95, p99 and throughput. A delay's EFFECT is "completed", while the cost shows in the route times.
  • Recent faults: an exchange faulted again on its redeliveries is shown once, with ×N.

Terminal UI, MCP

  • A tab can say that Esc only cancels its confirm (MonitorTab.isConfirmCancelledByEsc()); only the Chaos tab does. Then a lone Esc from tui_send_keys gets through, so an AI can close a confirm it opened; before, it stayed until a person pressed Esc. Every other key, and Esc for every other dialog, is still dropped (CAMEL-25444). The guard is unchanged for the dialogs where Esc means another answer, such as an AI edit waiting to be saved.

Not in this PR: ! after tui_navigate to a Diagram node took the route entry once. I could not reproduce it reliably to find the cause, so it stays open on the JIRA.

Tests

  • camel-chaos: aDecidedExpectationCountsOnUntilTheTimeIsUp. All 651 camel-chaos tests pass.
  • TUI: pick order and poll targets (ChaosRecipesTest), short fault, poll effect, in-flight mark, grouped faults and the routes line (ChaosTabRenderTest), and Esc (ConfirmationsTest). All 2330 TUI module tests pass. LaunchManagerOutcomeTest failed once and passed on the rerun; it's unrelated.
  • Live: the demo with 4 rules (step error, file poll error, a delay on the HTTP stock call, a flapping shipping route) in a TUI built from this branch.

Claude Code on behalf of Claus Ibsen

🤖 Generated with Claude Code

https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS

…pectation count, effect of delays and polls

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. No issues found.

The expectation count fix in ChaosRule.recordAt() is correct — count continues after decision without affecting the lost calculation (guarded by op != AT_MOST and Math.max(0, ...)). The poll/scheduled consumer distinction (schedulerClass != null) cleanly excludes timers. The producer pick-order logic and Esc key gating are well-scoped, and the new tests validate the pre-fix behaviour correctly.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-chaos
  • dsl/camel-jbang/camel-jbang-plugin-tui

🔬 Scalpel shadow comparison — Scalpel: 11 of 717 tested, 27 compile-only — current: 11 all tested

Maveniverse Scalpel detected 11 affected modules (current approach: 11).

Skip-tests mode would test 11 modules (2 direct + 9 downstream), skip tests for 27 (generated code, meta-modules)

Modules Scalpel would test (11)
  • camel-chaos ← components/camel-chaos/src/main/java/org/apache/camel/component/chaos/ChaosRule.java, components/camel-chaos/src/test/java/org/apache/camel/component/chaos/ChaosRuleTest.java
  • camel-cli-connector ← downstream of org.apache.camel:camel-chaos
  • camel-cli-debug ← downstream of org.apache.camel:camel-cli-connector
  • camel-jbang-mcp ← downstream of org.apache.camel:camel-chaos
  • camel-jbang-plugin-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-tui ← dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ChaosHere.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ChaosInfo.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ChaosRecipes.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ChaosTab.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/Confirmations.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ConsumerInfo.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/McpFacade.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/MonitorTab.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/StatusParser.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiToolRegistry.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/help/chaos.md, dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/ChaosRecipesTest.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/ChaosTabRenderTest.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/ConfirmationsTest.java
  • camel-jbang-plugin-validate ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-run ← downstream of org.apache.camel:camel-catalog
  • camel-launcher-container ← downstream of org.apache.camel:camel-launcher
  • camel-yaml-dsl-validator ← downstream of org.apache.camel:camel-catalog
  • camel-yaml-dsl-validator-maven-plugin ← downstream of org.apache.camel:camel-yaml-dsl-validator
Modules with tests skipped (27)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

All tested modules (38 modules, 6m 16s total)

Total reactor time: 6m 16s

Module Duration Status
Camel :: JBang :: MCP 58.2s SUCCESS
Camel :: Component DSL 45.7s SUCCESS
Camel :: Docs 38.9s SUCCESS
Camel :: YAML DSL :: Validator 34.2s SUCCESS
Camel :: JBang :: Plugin :: Validate 26.1s SUCCESS
Camel :: Catalog :: Camel Catalog 26.1s SUCCESS
Camel :: JBang :: Run 22.0s SUCCESS
Camel :: YAML DSL 19.4s SUCCESS
Camel :: JBang :: Plugin :: Kubernetes 19.0s SUCCESS
Camel :: JBang :: Plugin :: Testing 13.0s SUCCESS
Camel :: Catalog :: Camel Report Maven Plugin 10.3s SUCCESS
Camel :: Kamelet Main 10.2s SUCCESS
Camel :: All Components Sync point 6.5s SUCCESS
Camel :: YAML DSL :: Deserializers 6.4s SUCCESS
Camel :: JBang :: Plugin :: Generate 6.2s SUCCESS
Camel :: Catalog :: Suggest (deprecated) 5.9s SUCCESS
Camel :: Catalog :: Camel Route Parser 5.2s SUCCESS
Camel :: Catalog :: Maven 3.0s SUCCESS
Camel :: YAML DSL :: Validator Maven Plugin 2.9s SUCCESS
Camel :: JBang :: Plugin :: MCP 2.5s SUCCESS
Camel :: YAML DSL :: Maven Plugins 2.3s SUCCESS
Camel :: Assembly 2.1s SUCCESS
Camel :: Endpoint DSL :: Support 1.9s SUCCESS
Camel :: Catalog :: Dummy Component 1.8s SUCCESS
Camel :: Coverage 1.4s SUCCESS
Camel :: DSL :: CLI Debug 1.1s SUCCESS
Camel :: JBang :: Integration tests 1.1s SUCCESS
Camel :: JBang :: Plugin :: Edit 0.9s SUCCESS
Camel :: JBang :: Main 0.7s SUCCESS
Camel :: Launcher :: Container 0.5s SUCCESS
Camel :: Catalog :: Console 0.5s SUCCESS
Camel :: Chaos n/a
Camel :: DSL :: CLI Connector n/a
Camel :: Endpoint DSL n/a
Camel :: Integration Tests n/a
Camel :: JBang :: Core n/a
Camel :: JBang :: Plugin :: TUI n/a
Camel :: Launcher n/a

Top 20 slowest modules:

  • Camel :: JBang :: MCP (58.2s)
  • Camel :: Component DSL (45.7s)
  • Camel :: Docs (38.9s)
  • Camel :: YAML DSL :: Validator (34.2s)
  • Camel :: JBang :: Plugin :: Validate (26.1s)
  • Camel :: Catalog :: Camel Catalog (26.1s)
  • Camel :: JBang :: Run (22.0s)
  • Camel :: YAML DSL (19.4s)
  • Camel :: JBang :: Plugin :: Kubernetes (19.0s)
  • Camel :: JBang :: Plugin :: Testing (13.0s)
  • Camel :: Catalog :: Camel Report Maven Plugin (10.3s)
  • Camel :: Kamelet Main (10.2s)
  • Camel :: All Components Sync point (6.5s)
  • Camel :: YAML DSL :: Deserializers (6.4s)
  • Camel :: JBang :: Plugin :: Generate (6.2s)
  • Camel :: Catalog :: Suggest (deprecated) (5.9s)
  • Camel :: Catalog :: Camel Route Parser (5.2s)
  • Camel :: Catalog :: Maven (3.0s)
  • Camel :: YAML DSL :: Validator Maven Plugin (2.9s)
  • Camel :: JBang :: Plugin :: MCP (2.5s)

⚙️ View full build and test results

@davsclaus
davsclaus merged commit fdbc617 into main Nov 6, 2026
6 checks passed
@davsclaus
davsclaus deleted the CAMEL-26699-chaos-screen-findings branch November 6, 2026 21:08
@davsclaus davsclaus added this to the 4.24.0 milestone Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants