This is an automated email from the ASF dual-hosted git repository.
xintongsong pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-agents.git
The following commit(s) were added to refs/heads/main by this push:
new 1da56c9b [hotfix] Make cross-language e2e test order-insensitive and
add request time (#713)
1da56c9b is described below
commit 1da56c9be04f272397f16bda4f16bc3af281b1cd
Author: Kerui Wang <[email protected]>
AuthorDate: Sun May 31 15:21:29 2026 +0800
[hotfix] Make cross-language e2e test order-insensitive and add request
time (#713)
---
.../agents/resource/test/ChatModelCrossLanguageAgent.java | 1 +
.../chat_model_cross_language_test.py | 5 +++--
.../yaml_cross_language_test.py | 10 ++++++----
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git
a/e2e-test/flink-agents-end-to-end-tests-resource-cross-language/src/test/java/org/apache/flink/agents/resource/test/ChatModelCrossLanguageAgent.java
b/e2e-test/flink-agents-end-to-end-tests-resource-cross-language/src/test/java/org/apache/flink/agents/resource/test/ChatModelCrossLanguageAgent.java
index a21b2e55..dec65704 100644
---
a/e2e-test/flink-agents-end-to-end-tests-resource-cross-language/src/test/java/org/apache/flink/agents/resource/test/ChatModelCrossLanguageAgent.java
+++
b/e2e-test/flink-agents-end-to-end-tests-resource-cross-language/src/test/java/org/apache/flink/agents/resource/test/ChatModelCrossLanguageAgent.java
@@ -78,6 +78,7 @@ public class ChatModelCrossLanguageAgent extends Agent {
return ResourceDescriptor.Builder.newBuilder(
ResourceName.ChatModel.PYTHON_WRAPPER_CONNECTION)
.addInitialArgument("pythonClazz",
ResourceName.ChatModel.Python.OLLAMA_CONNECTION)
+ .addInitialArgument("request_timeout", 240)
.build();
}
diff --git
a/python/flink_agents/e2e_tests/e2e_tests_resource_cross_language/chat_model_cross_language_test.py
b/python/flink_agents/e2e_tests/e2e_tests_resource_cross_language/chat_model_cross_language_test.py
index c1711095..8af10c3f 100644
---
a/python/flink_agents/e2e_tests/e2e_tests_resource_cross_language/chat_model_cross_language_test.py
+++
b/python/flink_agents/e2e_tests/e2e_tests_resource_cross_language/chat_model_cross_language_test.py
@@ -106,5 +106,6 @@ def test_java_chat_model_integration(
with file.open() as f:
actual_result.extend(f.readlines())
- assert "3" in actual_result[0]
- assert "cat" in actual_result[1]
+ joined = "\n".join(actual_result).lower()
+ assert "3" in joined, f"math answer missing '3': {actual_result!r}"
+ assert "cat" in joined, f"creative answer missing 'cat': {actual_result!r}"
diff --git
a/python/flink_agents/e2e_tests/e2e_tests_resource_cross_language/yaml_cross_language_test.py
b/python/flink_agents/e2e_tests/e2e_tests_resource_cross_language/yaml_cross_language_test.py
index 442c729e..ee9ed231 100644
---
a/python/flink_agents/e2e_tests/e2e_tests_resource_cross_language/yaml_cross_language_test.py
+++
b/python/flink_agents/e2e_tests/e2e_tests_resource_cross_language/yaml_cross_language_test.py
@@ -154,8 +154,10 @@ def test_yaml_cross_language_agent(
# Math path went through the Java ``calculateBMI`` tool:
# 70 / (1.75 * 1.75) ≈ 22.86, so the final answer should mention 22.
- assert "22" in actual_result[0], f"math answer missing '22':
{actual_result[0]!r}"
# Creative path doesn't use any tool.
- assert "cat" in actual_result[1].lower(), (
- f"creative answer missing 'cat': {actual_result[1]!r}"
- )
+ # NOTE: We join all results and search without relying on order, because
+ # StreamingFileSink may produce multiple part files and iterdir() does not
+ # guarantee a deterministic traversal order across platforms.
+ joined = "\n".join(actual_result).lower()
+ assert "22" in joined, f"math answer missing '22': {actual_result!r}"
+ assert "cat" in joined, f"creative answer missing 'cat': {actual_result!r}"