dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.25k stars 4.45k forks source link

[7.0] System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_Increment failed due to file being used by another process. #98191

Open carlossanlop opened 3 months ago

carlossanlop commented 3 months ago

Error Blob

{
  "ErrorMessage": "at System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_Increment",
  "BuildRetry": true,
  "ErrorPattern": "",
  "ExcludeConsoleLog": false
}

Reproduction Steps

C:\h\w\A50B0910\w\B37409CE\e>"C:\h\w\A50B0910\p\dotnet.exe" exec --runtimeconfig System.Diagnostics.PerformanceCounter.Tests.runtimeconfig.json --depsfile System.Diagnostics.PerformanceCounter.Tests.deps.json xunit.console.dll System.Diagnostics.PerformanceCounter.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing
Discovering: System.Diagnostics.PerformanceCounter.Tests (method display = ClassAndMethod, method display options = None) Discovered: System.Diagnostics.PerformanceCounter.Tests (found 86 of 92 test cases) Starting: System.Diagnostics.PerformanceCounter.Tests (parallel test collections = on, max threads = 2)

Info: Successfully installed performance counters in C:\h\w\A50B0910\t\j4eqc3tr.id5\provider.man System.Diagnostics.Tests.PerformanceDataTests.PerformanceCounter_PerformanceData [SKIP] Condition(s) not met: "IsRunnableEnvironment"

Info: Successfully uninstalled the performance counters from the counter definition XML file C:\h\w\A50B0910\t\j4eqc3tr.id5\provider.man. System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounterIncrement [FAIL] System.ComponentModel.Win32Exception : The process cannot access the file because it is being used by another process. Stack Trace: //src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs(1234,0): at System.Diagnostics.PerformanceCounterLib.RegisterFiles(String arg0, Boolean unregister) //src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs(1239,0): at System.Diagnostics.PerformanceCounterLib.UnregisterCategory(String categoryName) //src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterCategory.cs(392,0): at System.Diagnostics.PerformanceCounterCategory.Delete(String categoryName) //src/libraries/System.Diagnostics.PerformanceCounter/tests/Helpers.cs(56,0): at System.Diagnostics.Tests.Helpers.DeleteCategory(String categoryName) //src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterTests.cs(232,0): at System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounterIncrement() at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) //src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(69,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) Finished: System.Diagnostics.PerformanceCounter.Tests === TEST EXECUTION SUMMARY === System.Diagnostics.PerformanceCounter.Tests Total: 90, Errors: 0, Failed: 1, Skipped: 1, Time: 15.450s ----- end Fri 02/02/2024 18:18:23.80 ----- exit code 1 ---------------------------------------------------------- 2024-02-02T18:18:24.883Z INFO run.py run(48) main Beginning reading of test results. 2024-02-02T18:18:24.883Z INFO run.py init(42) read_results Searching 'C:\h\w\A50B0910\w\B37409CE\e' for test results files 2024-02-02T18:18:24.883Z INFO run.py init(48) read_results Found results file C:\h\w\A50B0910\w\B37409CE\e\testResults.xml with format xunit 2024-02-02T18:18:24.883Z INFO run.py init(42) read_results Searching 'C:\h\w\A50B0910\w\B37409CE\uploads' for test results files 2024-02-02T18:18:24.883Z INFO run.py packing_test_reporter(30) report_results Packing 90 test reports to 'C:\h\w\A50B0910\w\B37409CE\e__test_report.json' 2024-02-02T18:18:24.883Z INFO run.py packing_test_reporter(33) report_results Packed 27531 bytes Did not find dumps, skipping dump docs generation. ['System.Diagnostics.PerformanceCounter.Tests' END OF WORK ITEM LOG: Command exited with 0]


<!-- Known issue validation start -->
 ### Known issue validation
**Build: :mag_right:** https://dev.azure.com/dnceng-public/public/_build/results?buildId=551129
**Error message validated:** `[at System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_Increment`]
**Result validation:** :white_check_mark: Known issue matched with the provided build.
**Validation performed at:** 2/8/2024 11:11:13 PM UTC
<!-- Known issue validation end -->
<!--Known issue error report start -->

### Report
#### Summary
|24-Hour Hit Count|7-Day Hit Count|1-Month Count|
|---|---|---|
|0|0|0|
<!--Known issue error report end -->
ghost commented 3 months ago

Tagging subscribers to this area: @dotnet/area-system-diagnostics-performancecounter See info in area-owners.md if you want to be subscribed.

Issue Details
### Error Blob ```json { "ErrorMessage": "PerformanceCounterTests.cs(232,0): at System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_Increment()", "BuildRetry": false, "ErrorPattern": "", "ExcludeConsoleLog": true } ``` ### Reproduction Steps - Affected unrelated 7.0 PR: https://github.com/dotnet/runtime/pull/97883 - Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=551129 - Queue: `Libraries Test Run release coreclr windows x64 Debug` - Job result: https://dev.azure.com/dnceng-public/public/_build/results?buildId=551129&view=logs&j=55b384d0-d6b0-5894-fd8a-d754d713246e&t=8dcacd81-cb5e-5ac9-93e5-c3f19b19e19b&l=105 - Log file: https://helixre107v0xd1eu3ibi6ka.blob.core.windows.net/dotnet-runtime-refs-pull-97883-merge-03c423c2da50433783/System.Diagnostics.PerformanceCounter.Tests/1/console.bb477198.log?helixlogtype=result - Output: ``` =========================================================================================================== C:\h\w\A50B0910\w\B37409CE\e>"C:\h\w\A50B0910\p\dotnet.exe" exec --runtimeconfig System.Diagnostics.PerformanceCounter.Tests.runtimeconfig.json --depsfile System.Diagnostics.PerformanceCounter.Tests.deps.json xunit.console.dll System.Diagnostics.PerformanceCounter.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing Discovering: System.Diagnostics.PerformanceCounter.Tests (method display = ClassAndMethod, method display options = None) Discovered: System.Diagnostics.PerformanceCounter.Tests (found 86 of 92 test cases) Starting: System.Diagnostics.PerformanceCounter.Tests (parallel test collections = on, max threads = 2) Info: Successfully installed performance counters in C:\h\w\A50B0910\t\j4eqc3tr.id5\provider.man System.Diagnostics.Tests.PerformanceDataTests.PerformanceCounter_PerformanceData [SKIP] Condition(s) not met: "IsRunnableEnvironment" Info: Successfully uninstalled the performance counters from the counter definition XML file C:\h\w\A50B0910\t\j4eqc3tr.id5\provider.man. System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_Increment [FAIL] System.ComponentModel.Win32Exception : The process cannot access the file because it is being used by another process. Stack Trace: /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs(1234,0): at System.Diagnostics.PerformanceCounterLib.RegisterFiles(String arg0, Boolean unregister) /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs(1239,0): at System.Diagnostics.PerformanceCounterLib.UnregisterCategory(String categoryName) /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterCategory.cs(392,0): at System.Diagnostics.PerformanceCounterCategory.Delete(String categoryName) /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/Helpers.cs(56,0): at System.Diagnostics.Tests.Helpers.DeleteCategory(String categoryName) /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterTests.cs(232,0): at System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_Increment() at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(69,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) Finished: System.Diagnostics.PerformanceCounter.Tests === TEST EXECUTION SUMMARY === System.Diagnostics.PerformanceCounter.Tests Total: 90, Errors: 0, Failed: 1, Skipped: 1, Time: 15.450s ----- end Fri 02/02/2024 18:18:23.80 ----- exit code 1 ---------------------------------------------------------- 2024-02-02T18:18:24.883Z INFO run.py run(48) main Beginning reading of test results. 2024-02-02T18:18:24.883Z INFO run.py __init__(42) read_results Searching 'C:\h\w\A50B0910\w\B37409CE\e' for test results files 2024-02-02T18:18:24.883Z INFO run.py __init__(48) read_results Found results file C:\h\w\A50B0910\w\B37409CE\e\testResults.xml with format xunit 2024-02-02T18:18:24.883Z INFO run.py __init__(42) read_results Searching 'C:\h\w\A50B0910\w\B37409CE\uploads' for test results files 2024-02-02T18:18:24.883Z INFO run.py packing_test_reporter(30) report_results Packing 90 test reports to 'C:\h\w\A50B0910\w\B37409CE\e\__test_report.json' 2024-02-02T18:18:24.883Z INFO run.py packing_test_reporter(33) report_results Packed 27531 bytes Did not find dumps, skipping dump docs generation. ['System.Diagnostics.PerformanceCounter.Tests' END OF WORK ITEM LOG: Command exited with 0] ```
Author: carlossanlop
Assignees: -
Labels: `os-windows`, `arch-x64`, `blocking-clean-ci`, `runtime-coreclr`, `area-System.Diagnostics.PerformanceCounter`, `Known Build Error`
Milestone: -