-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test failure System.Diagnostics.Tests.ProcessTests.TotalProcessorTime_PerformLoop_TotalProcessorTimeValid #86739
Comments
Tagging subscribers to this area: @dotnet/area-system-diagnostics-process Issue DetailsFailed in: runtime-coreclr libraries-jitstress 20230524.1 Failed tests:
Error message:
Stack trace:
|
The person who is willing to work on this should verify in what scenario the asserted value could be more than runtime/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs Lines 902 to 910 in 7cf329b
|
The loop in that function may also go through OSR making it significantly slower (and consuming a lot more CPU), and given the high average load on test machines it does not surprise me that the test is flakey. There's a few more failures recently: https://runfo.azurewebsites.net/search/tests/?q=started%3A%7E7+name%3ATotalProcessorTimeValid Maybe the test should just be deleted, or it should retry a few times before failing if the result is above the expected range. |
The comment on the loop talks about 1 second of CPU time, yet the assert seems to try to validate that we expended less than 1 millisecond of CPU time. So maybe that's just what should be fixed? With OSR it's quite expected that this may take more than 1 ms since once it hits the threshold it will involve a full rejitting of the method. |
We could also just assert that the time is more than |
I cannot see how this can happen, unless it's some glitchy data in the /proc/./stat file. I will add logging. |
@danmoseley what makes you say this has to be glitchy data? The failures show that the CPU time is just barely more than 1 millisecond – not that much given that a full rejitting may have occurred. |
Am I misreading..cpu time is the numerator here, and the result is unexpectedly high. It means cpu time was high? |
If you merge my PR we will discover.. |
No, I was misreading it... |
Rather disappointed that it hasn't happened again yet. |
I will close and if it happens again we will know more. |
We hit this in superpmi-collect: https://helixri107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-heads-main-e4ba4e2b24654b5292/System.Diagnostics.Process.Tests/1/console.f3cae831.log?sv=2021-08-06&se=2024-01-27T17%3A55%3A37Z&sr=c&sp=rl&sig=cEizO0GVk3rmTXFRQ0nozUzyNav4Ro9rpqRZSgQNYik%3D System.Diagnostics.Tests.ProcessTests.TotalProcessorTime_PerformLoop_TotalProcessorTimeValid [FAIL]
Assertion failed. 1.1390753259881705 is not in range [0,1]. proc time before:51296.875 proc time after:51484.375 timeDiff:82.3036 cpuTimeDiff:187.5 Environment.ProcessorCount:2
Stack Trace:
/_/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs(922,0): at System.Diagnostics.Tests.ProcessTests.TotalProcessorTime_PerformLoop_TotalProcessorTimeValid()
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
/_/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.CoreCLR.cs(36,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
/_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) Is it possible that using |
@jakobbotsch Could be - whatever the cause it is probably reasonable to just make the wait longer. Do you want to make that change? |
Also double the number of iterations (it was executing in about 80 ms before on an x86 CI run). Fix dotnet#86739 (presumably, it fails very rarely, so let's reopen if it happens again)
Failed in: runtime-coreclr libraries-jitstress 20230524.1
Failed tests:
Error message:
Stack trace:
The text was updated successfully, but these errors were encountered: