Skip to content

CAMEL-23206: Fix flaky SpringAiChatParameterOverrideIT#22084

Merged
gnodet merged 3 commits intomainfrom
CAMEL-23206
Mar 19, 2026
Merged

CAMEL-23206: Fix flaky SpringAiChatParameterOverrideIT#22084
gnodet merged 3 commits intomainfrom
CAMEL-23206

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Mar 18, 2026

Summary

  • Replace fragile content assertion in testTopPOverrideViaHeader — AI-generated text is non-deterministic even with top_p=0.1, so checking for specific words ("blue", "above", "high") is unreliable
  • The test verifies that the TOP_P parameter override via header works correctly; response content validation is not the test's purpose

Test plan

  • CI green (test is @DisabledIfSystemProperty in CI, runs locally with Ollama)

The testTopPOverrideViaHeader test asserted that AI-generated text
contained specific words ("blue", "above", "high"), which is
non-deterministic. Replace with isNotEmpty() check since the test's
purpose is to verify the top_p parameter override works, not to
validate model output content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
assertThat(response).isNotNull();
// With low top_p, should get more deterministic responses
assertThat(response.toLowerCase()).containsAnyOf("blue", "above", "high");
assertThat(response).isNotEmpty();
Copy link
Contributor

@apupier apupier Mar 18, 2026

Choose a reason for hiding this comment

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

the problem is that we are checking almost anything anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Improved the assertion to verify the response has multiple words and check the token count header is set, which validates the topP parameter override actually worked. Simply checking isNotEmpty() was indeed too weak.

@gnodet
Copy link
Contributor Author

gnodet commented Mar 18, 2026

Local test run (actual IT execution via mvn verify): ALL 6 TESTS PASSED

[INFO] Running org.apache.camel.component.springai.chat.SpringAiChatParameterOverrideIT
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 57.14 s
BUILD SUCCESS

Ran against local Ollama via testcontainers.

@github-actions
Copy link
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 build-all, build-dependents, 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.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2026

🧪 CI tested the following changed modules:

  • components/camel-spring-parent/camel-spring-ai/camel-spring-ai-chat
Full reactor (72 modules)
  • Camel :: All Components Sync point
  • Camel :: All Components Sync point [pom]
  • Camel :: Assembly
  • Camel :: Assembly [pom]
  • Camel :: Catalog :: CSimple Maven Plugin (deprecated) [maven-plugin]
  • Camel :: Catalog :: CSimple Maven Plugin (deprecated) SUCCESS [ 1.655 s]
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Catalog :: Camel Catalog [jar]
  • Camel :: Catalog :: Camel Report Maven Plugin
  • Camel :: Catalog :: Camel Report Maven Plugin [maven-plugin]
  • Camel :: Catalog :: Camel Route Parser
  • Camel :: Catalog :: Camel Route Parser [jar]
  • Camel :: Catalog :: Console
  • Camel :: Catalog :: Console [jar]
  • Camel :: Catalog :: Dummy Component
  • Camel :: Catalog :: Dummy Component [jar]
  • Camel :: Catalog :: Lucene (deprecated)
  • Camel :: Catalog :: Lucene (deprecated) [jar]
  • Camel :: Catalog :: Maven
  • Camel :: Catalog :: Maven [jar]
  • Camel :: Catalog :: Suggest
  • Camel :: Catalog :: Suggest [jar]
  • Camel :: Component DSL
  • Camel :: Component DSL [jar]
  • Camel :: Coverage
  • Camel :: Coverage [pom]
  • Camel :: Docs
  • Camel :: Docs [pom]
  • Camel :: Endpoint DSL
  • Camel :: Endpoint DSL [jar]
  • Camel :: Endpoint DSL :: Support
  • Camel :: Endpoint DSL :: Support [jar]
  • Camel :: Integration Tests
  • Camel :: Integration Tests [jar]
  • Camel :: JBang :: Core
  • Camel :: JBang :: Core [jar]
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: Integration tests [jar]
  • Camel :: JBang :: MCP
  • Camel :: JBang :: MCP [jar]
  • Camel :: JBang :: Main
  • Camel :: JBang :: Main [jar]
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Edit [jar]
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Generate [jar]
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: Kubernetes [jar]
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: Route Parser [jar]
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Testing [jar]
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: JBang :: Plugin :: Validate [jar]
  • Camel :: Kamelet Main
  • Camel :: Kamelet Main [jar]
  • Camel :: Launcher
  • Camel :: Launcher [jar]
  • Camel :: Launcher :: Container
  • Camel :: Launcher :: Container [pom]
  • Camel :: Spring AI :: Chat
  • Camel :: Spring AI :: Chat [jar]
  • Camel :: YAML DSL
  • Camel :: YAML DSL [jar]
  • Camel :: YAML DSL :: Deserializers
  • Camel :: YAML DSL :: Deserializers [jar]
  • Camel :: YAML DSL :: Maven Plugins
  • Camel :: YAML DSL :: Maven Plugins [maven-plugin]
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator [jar]
  • Camel :: YAML DSL :: Validator Maven Plugin
  • Camel :: YAML DSL :: Validator Maven Plugin [maven-plugin]

gnodet and others added 2 commits March 18, 2026 17:08
Instead of just isNotEmpty(), verify the response has multiple words
and check token count header is set, which validates the topP parameter
override actually worked.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet merged commit c4b6863 into main Mar 19, 2026
5 checks passed
@gnodet gnodet deleted the CAMEL-23206 branch March 20, 2026 08:20
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