-
Notifications
You must be signed in to change notification settings - Fork 329
Labels
in: waterflowIssues in Waterflow modulesIssues in Waterflow modulestype: bugA general bugA general bug
Milestone
Description
问题摘要 / Issue Summary
WaterFlowsTest.test_map_with_preserved_order 测试用例偶现失败,期望 sessionId 为具体值但实际为 null
版本信息 / Version Information
其他 (请在下方说明) / Other: v3.5.4-SNAPSHOT
浏览器 / Browser
不适用 - 这是后端测试问题
操作系统 / Operating System
macOS (Apple Silicon)
发生了什么?/ What happened?
在本地编译运行 waterflow-core 模块的测试时,test_map_with_preserved_order 测试用例偶现失败。
测试失败信息:
[ERROR] Tests run: 43, Failures: 1, Errors: 0, Skipped: 5, Time elapsed: 18.00 s <<< FAILURE! -- in modelengine.fit.waterflow.domain.WaterFlowsTest$WaterFlowBaseLineTest
[ERROR] modelengine.fit.waterflow.domain.WaterFlowsTest$WaterFlowBaseLineTest.test_map_with_preserved_order -- Time elapsed: 0.339 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <4aff210b-4ba9-4826-ae46-e73442201969> but was: <null>
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at modelengine.fit.waterflow.domain.WaterFlowsTest$WaterFlowBaseLineTest.test_map_with_preserved_order(WaterFlowsTest.java:170)
具体失败在第 170 行:
assertEquals(session.getId(), sessionId.get());期望 sessionId.get() 应该返回 session 的 ID(例如 4aff210b-4ba9-4826-ae46-e73442201969),但实际返回的是 null。
期望的行为 / Expected Behavior
测试应该稳定通过。在测试中:
- 创建一个带有 preserved order 的 FlowSession
- 通过 flow 处理 5 个数据项
- 在 window.complete() 后,onComplete 回调应该被调用并设置 sessionId
- sessionId.get() 应该返回实际的 session ID 而不是 null
重现步骤 / Steps to Reproduce
- 进入
framework/waterflow/java/waterflow-core目录 - 执行
mvn clean test - 观察测试结果 - 问题偶现,可能需要多次运行才能复现
相关日志 / Relevant Logs
完整的测试输出日志:
[INFO] Running modelengine.fit.waterflow.domain.WaterFlowsTest$WaterFlowBaseLineTest
reduce value=10, acc=10
reduce value=11, acc=1011
reduce value=20, acc=101120
reduce value=21, acc=10112021
reduce value=30, acc=1011202130
reduce value=31, acc=101120213031
reduce value=10, acc=10
reduce value=11, acc=21
reduce value=20, acc=41
reduce value=21, acc=62
value=62
[ERROR] Tests run: 43, Failures: 1, Errors: 0, Skipped: 5, Time elapsed: 18.00 s <<< FAILURE! -- in modelengine.fit.waterflow.domain.WaterFlowsTest$WaterFlowBaseLineTest
[ERROR] modelengine.fit.waterflow.domain.WaterFlowsTest$WaterFlowBaseLineTest.test_map_with_preserved_order -- Time elapsed: 0.339 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <4aff210b-4ba9-4826-ae46-e73442201969> but was: <null>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at modelengine.fit.waterflow.domain.WaterFlowsTest$WaterFlowBaseLineTest.test_map_with_preserved_order(WaterFlowsTest.java:170)
测试代码位置: framework/waterflow/java/waterflow-core/src/test/java/modelengine/fit/waterflow/domain/WaterFlowsTest.java:148-176
额外信息 / Additional Context
- 这是一个偶现问题,不是每次都会失败
- 涉及到 preserved order (顺序保证) 和异步回调机制
- 可能与时序/竞态条件有关,因为测试中使用了 SleepUtil.sleep() 来控制时序
- onComplete 回调可能在某些情况下没有被正确触发,或者在断言执行之前没有完成
分支: fit-enhancement-zip
模块: framework/waterflow/java/waterflow-core
✅ 我已经搜索了现有的issues,确认这不是重复问题
✅ 我已经阅读了项目文档和 FAQ
✅ 我提供的信息准确完整
✅ 我愿意协助测试问题修复
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
in: waterflowIssues in Waterflow modulesIssues in Waterflow modulestype: bugA general bugA general bug