我从命令行使用 dotCover.exe 生成覆盖率报告,但随机失败并出现此错误:
[JetBrains dotCover] Coverage session finished with errors: Out of allowed iteration to generate unique temp name
[location] = C:\Build Agent\work\f532b5455ffc19e9\Profiler\Kernel\Windows\Native\Solution\core\src\Util\temp_util.cpp(44)
[function] = class boost::filesystem::path __cdecl jetbrains::profiler::temp::`anonymous-namespace'::create_temp<class jetbrains::profiler::temp::create_temp_file::<lambda_91d5f1a5933e4e60038be7ca777762a9>,0x010>(const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,class jetbrains::profiler::temp::create_temp_file::<lambda_91d5f1a5933e4e60038be7ca777762a9> &&)
[file name] = C:\Temp\ft.EC76593C.tmp
[WIN32 error] = 80, The file exists.
我的命令行是这样的:
dotCover.exe analyse /TargetExecutable=nunit3-console.exe /TargetArguments="unittest1.dll unittest2.dll ... unittest10.dll" /ReportType="html" /Output=CodeCoverage.html /Filters="+:*;-:*.*Tests;-:*.*.Tests;-:*.Tests;-:*.Tests*" /TempDir=C:\Temp\
似乎我尝试覆盖的 DLL 越多,出现此错误的可能性就越大。从错误消息来看,dotCover 似乎是用 C++ 编写的,它正在使用 boost::filesystem::path
创建一个临时文件,但存在一些竞争条件,它会尝试在它所在的位置创建一个新的临时文件已经存在。我的 dotCover 版本是 JetBrains dotCover Console Runner 2017.1.2。构建 108.0.20170428.80910
。
有谁知道如何修复该错误?
编辑:还有另一个错误导致失败 - Access is denied
:
[function] = class boost::filesystem::path __cdecl jetbrains::profiler::temp::`anonymous-namespace'::create_temp<class jetbrains::profiler::temp::create_temp_file::<lambda_91d5f1a5933e4e60038be7ca777762a9>,0x010>(const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,class jetbrains::profiler::temp::create_temp_file::<lambda_91d5f1a5933e4e60038be7ca777762a9> &&)
[file name] = C:\Temp2\ft.0A96C261.tmp
[WIN32 error] = 5, Access is denied.
同样,这也是随机发生的——通常它会失败 3 次,然后在第 4 次成功运行。
最佳答案
有时会遇到这个问题,使用早期访问版本 (JetBrains.dotCover.CommandLineTools.2017.2.20170630.95316-eap06) 使其消失到现在。
Looks like a bug in the dotcover tool opened here .You can download the latest version of dotcover commandline tools from here
编辑:
从here获取最新版本的dotcover|因为它已经解决了问题
关于c# - JetBrains 点封面 : Coverage session finished with errors: Out of allowed iteration to generate unique temp name,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44783936/