我从命令行使用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. Build 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日成功运行。