Closed
[test] tests/ut 多个 UT 文件存在 60+ 处被注释的有效断言(集中在 profileapi/profiler/arg_loader),建议核实恢复或显式注明原因 #1284
eieieiAdd on 29 days agoClosed at 25 days ago
duanpengliang
29 days ago Comments:
29 days ago Comments:
初步分析,当前源码确有 UT 关键结果未校验的问题:部分接口返回值被后续调用覆盖,trace 中还有调用与断言一并被注释、实际未执行的异常场景。这会削弱相关测试发现回归的能力,现有证据不能据此认定生产接口异常。
恢复时需区分纯断言注释、整段场景禁用及已有替代校验的情况,核对输入和预期结果后分批处理。我们会尽快核实禁用原因并补齐有效校验,可先从参数加载相关用例开展小范围整改,在对应 UT 环境验证。


29 days ago Assign wsnidie1、zhuliangying as responsible person
28 days ago Removed responsible person zhuliangying
28 days ago Assign xiao_cun as responsible person
28 days ago Removed responsible person xiao_cun
28 days ago Assign ykl999 as responsible person
28 days ago Assign m0_60337577 as responsible person
27 days ago Associated pull request
25 days ago changed custom state from 进行中 to 已解决
25 days ago Close issue
25 days ago Added label: resolved
现象
扫描
tests/ut发现多处存活测试体内部的断言被整行注释,而相邻用例/相邻行有激活的同款断言。典型如tests/ut/test/rt_utest_profileapi.cc:error = rtMemcpyAsync(devPtr, 64, hostPtr, 64, RT_MEMCPY_HOST_TO_DEVICE, stream_); // EXPECT_EQ(error, RT_ERROR_NONE); <-- 注释掉 error = rtStreamSynchronize(stream_); EXPECT_EQ(error, RT_ERROR_NONE); <-- 相邻断言激活这些用例调用后不校验返回值,覆盖失真;个别是"代码+断言"成对注释(如
rtDeviceReset(0)调用与断言一起被禁用),性质是禁用用例段,恢复需先确认意图。明细(master 现状,行号为该文件内被注释断言所在行)
tests/ut/test/rt_utest_profileapi.cctests/ut/test/platform/910B/rt_utest_profileapi.cc(同源副本)tests/ut/test/rt_utest_profiler.cctests/ut/test/platform/910B/rt_utest_profiler.cctests/ut/test/rt_utest_arg_loader.cctests/ut/test/platform/others/rt_utest_api_impl.cctests/ut/test/platform/others/rt_utest_npu_driver.cctests/ut/test/rt_utest_model.cctests/ut/test/platform/910B/rt_utest_api_test.cctests/ut/atrace/ut/utrace/testcase/trace_util_utest.cctests/ut/driver-stub/test/drv_utest_dispatch.cc建议
若方向确认,我可以从单一文件(如 rt_utest_arg_loader.cc,5 处)开始提交恢复 PR 验证。