运行 在并行模式下测试时,如何修复丢失的 simulink 仿真技巧问题?
How to fix missing simulink simulation artificats issue when running test in parallel mode?
我有 29 Simulink/Matlab 测试。它有很多不同的参考模型。在 运行 进行 20 秒模拟之前,它必须加载所有参考模型并在工作文件夹中创建大量模拟工件。大量参考模型在测试之间共享。
当 运行 一次测试一个时,我没有问题,所有模拟工件都已创建并用于 运行 各种模拟。一切都会过去。
当运行全部通过并行处理进行处理时。我有一个 issue.Some 模拟工件未构建或丢失,因此我的模拟甚至在 running.But 之前就失败了,令人惊讶的是,并不是所有 29 个都失败了。它实际上是 运行dom,上次是 17,另一次是 22。甚至 运行 一次 0 失败。
另请注意,出于 CI 目的,当 运行 在 Azure-Pipelines 上的自托管计算机上将其 运行 时,我只会遇到此问题。
我想解决此问题并一次重现稳定的测试 pass/fail 结果 运行,但在并行过程中 运行。我该怎么做?
错误:
2020-11-03T03:16:27.1083996Z Making simulation target "Foo_src_sfun", ...
2020-11-03T03:16:27.1084227Z
2020-11-03T03:16:27.1084361Z
2020-11-03T03:16:27.1084502Z
2020-11-03T03:16:27.1084789Z Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
2020-11-03T03:16:27.1085188Z Copyright (C) Microsoft Corporation. All rights reserved.
2020-11-03T03:16:27.1085441Z
2020-11-03T03:16:27.1085815Z NMAKE : fatal error U1052: file 'Foo_src_sfun.mak' not found
2020-11-03T03:16:27.1086175Z Stop.
2020-11-03T03:16:27.1089399Z ================================================================================
2020-11-03T03:16:27.1089936Z Error occurred in TestSim/testSim(File=test_FooTest1_slx) and it did not run to completion.
2020-11-03T03:16:27.1090308Z
2020-11-03T03:16:27.1090497Z ---------
2020-11-03T03:16:27.1090720Z Error ID:
2020-11-03T03:16:27.1090946Z ---------
2020-11-03T03:16:27.1091254Z 'Slvnv:simcoverage:SimulationFailed'
2020-11-03T03:16:27.1091481Z
2020-11-03T03:16:27.1091669Z --------------
2020-11-03T03:16:27.1091919Z Error Details:
2020-11-03T03:16:27.1092186Z --------------
2020-11-03T03:16:27.1092419Z Error using cvsim
2020-11-03T03:16:27.1092659Z Simulation failed
2020-11-03T03:16:27.1092864Z
2020-11-03T03:16:27.1093112Z Error in testRunner (line 145)
2020-11-03T03:16:27.1093477Z [cvdo, simOutRes] = cvsim(testObj,paramStruct) ;
2020-11-03T03:16:27.1093765Z
2020-11-03T03:16:27.1094034Z Error in TestSim/testSim (line 30)
2020-11-03T03:16:27.1094373Z [cvdo, simOutRes, ErrLog] = testRunner(File,20);
2020-11-03T03:16:27.1094638Z
2020-11-03T03:16:27.1094830Z Caused by:
2020-11-03T03:16:27.1095168Z Error using autobuild_kernel>autobuild_local (line 219)
2020-11-03T03:16:27.1095612Z Unable to create mex function 'Foo_src_sfun.mexw64'
2020-11-03T03:16:27.1096006Z required for simulation.
2020-11-03T03:16:27.1096427Z ================================================================================
更新:
我发现我还有另一种错误,导致几乎相同的结果。
2020-11-03T03:18:36.1668328Z Making simulation target "Foo2_src_sfun", ...
2020-11-03T03:18:36.1668601Z
2020-11-03T03:18:36.1668735Z
2020-11-03T03:18:36.1669087Z 'Foo2_src_sfun.bat' is not recognized as an internal or external command,
2020-11-03T03:18:36.1669483Z operable program or batch file.
2020-11-03T03:18:36.1669685Z
2020-11-03T03:18:36.1669892Z >>Removing MiL paths...
2020-11-03T03:18:36.1670104Z >>Done
我在并行 运行 之前 运行 做了一个 运行SingleTest()。在 运行ning 之前,它会在 **/work/sim_artifact 文件夹中创建所有必需的模型参考 mexw64 文件。
因此,当并行 运行 他们不需要创建任何新文件时,他们要么使用已有的文件,要么更新文件。
自那次更改以来,我一直没有遇到任何问题。由于重复测试,运行 时间更长。
我有 29 Simulink/Matlab 测试。它有很多不同的参考模型。在 运行 进行 20 秒模拟之前,它必须加载所有参考模型并在工作文件夹中创建大量模拟工件。大量参考模型在测试之间共享。
当 运行 一次测试一个时,我没有问题,所有模拟工件都已创建并用于 运行 各种模拟。一切都会过去。
当运行全部通过并行处理进行处理时。我有一个 issue.Some 模拟工件未构建或丢失,因此我的模拟甚至在 running.But 之前就失败了,令人惊讶的是,并不是所有 29 个都失败了。它实际上是 运行dom,上次是 17,另一次是 22。甚至 运行 一次 0 失败。
另请注意,出于 CI 目的,当 运行 在 Azure-Pipelines 上的自托管计算机上将其 运行 时,我只会遇到此问题。
我想解决此问题并一次重现稳定的测试 pass/fail 结果 运行,但在并行过程中 运行。我该怎么做?
错误:
2020-11-03T03:16:27.1083996Z Making simulation target "Foo_src_sfun", ...
2020-11-03T03:16:27.1084227Z
2020-11-03T03:16:27.1084361Z
2020-11-03T03:16:27.1084502Z
2020-11-03T03:16:27.1084789Z Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
2020-11-03T03:16:27.1085188Z Copyright (C) Microsoft Corporation. All rights reserved.
2020-11-03T03:16:27.1085441Z
2020-11-03T03:16:27.1085815Z NMAKE : fatal error U1052: file 'Foo_src_sfun.mak' not found
2020-11-03T03:16:27.1086175Z Stop.
2020-11-03T03:16:27.1089399Z ================================================================================
2020-11-03T03:16:27.1089936Z Error occurred in TestSim/testSim(File=test_FooTest1_slx) and it did not run to completion.
2020-11-03T03:16:27.1090308Z
2020-11-03T03:16:27.1090497Z ---------
2020-11-03T03:16:27.1090720Z Error ID:
2020-11-03T03:16:27.1090946Z ---------
2020-11-03T03:16:27.1091254Z 'Slvnv:simcoverage:SimulationFailed'
2020-11-03T03:16:27.1091481Z
2020-11-03T03:16:27.1091669Z --------------
2020-11-03T03:16:27.1091919Z Error Details:
2020-11-03T03:16:27.1092186Z --------------
2020-11-03T03:16:27.1092419Z Error using cvsim
2020-11-03T03:16:27.1092659Z Simulation failed
2020-11-03T03:16:27.1092864Z
2020-11-03T03:16:27.1093112Z Error in testRunner (line 145)
2020-11-03T03:16:27.1093477Z [cvdo, simOutRes] = cvsim(testObj,paramStruct) ;
2020-11-03T03:16:27.1093765Z
2020-11-03T03:16:27.1094034Z Error in TestSim/testSim (line 30)
2020-11-03T03:16:27.1094373Z [cvdo, simOutRes, ErrLog] = testRunner(File,20);
2020-11-03T03:16:27.1094638Z
2020-11-03T03:16:27.1094830Z Caused by:
2020-11-03T03:16:27.1095168Z Error using autobuild_kernel>autobuild_local (line 219)
2020-11-03T03:16:27.1095612Z Unable to create mex function 'Foo_src_sfun.mexw64'
2020-11-03T03:16:27.1096006Z required for simulation.
2020-11-03T03:16:27.1096427Z ================================================================================
更新:
我发现我还有另一种错误,导致几乎相同的结果。
2020-11-03T03:18:36.1668328Z Making simulation target "Foo2_src_sfun", ...
2020-11-03T03:18:36.1668601Z
2020-11-03T03:18:36.1668735Z
2020-11-03T03:18:36.1669087Z 'Foo2_src_sfun.bat' is not recognized as an internal or external command,
2020-11-03T03:18:36.1669483Z operable program or batch file.
2020-11-03T03:18:36.1669685Z
2020-11-03T03:18:36.1669892Z >>Removing MiL paths...
2020-11-03T03:18:36.1670104Z >>Done
我在并行 运行 之前 运行 做了一个 运行SingleTest()。在 运行ning 之前,它会在 **/work/sim_artifact 文件夹中创建所有必需的模型参考 mexw64 文件。
因此,当并行 运行 他们不需要创建任何新文件时,他们要么使用已有的文件,要么更新文件。
自那次更改以来,我一直没有遇到任何问题。由于重复测试,运行 时间更长。