runtime
runtime copied to clipboard
ProcessThreadTests.TestStartTimeProperty failed in CI
Build Information
Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=707064 Build error leg or test failing: System.Diagnostics.Tests.ProcessThreadTests.TestStartTimeProperty Pull request: https://github.com/dotnet/runtime/pull/103309
Error Message
Fill the error message using step by step known issues guidance.
{
"ErrorMessage": "ProcessThreadTests.TestStartTimeProperty",
"ErrorPattern": "",
"BuildRetry": false,
"ExcludeConsoleLog": false
}
Exception Message
Assert.InRange() Failure: Value not in range
Range: (2024-06-13T19:52:03.7272386Z - 2024-06-13T19:52:07.7320077Z)
Actual: 2024-06-13T19:51:56.0017534Z
CallStack
at System.Diagnostics.Tests.ProcessThreadTests.<>c__DisplayClass4_2.<TestStartTimeProperty>b__0() in /_/src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.cs:line 154
at System.Threading.Tasks.Task.InnerInvoke() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2396
at System.Threading.Tasks.Task.<>c.<.cctor>b__292_0(Object obj) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2384
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 179
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 203
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2342
--- End of stack trace from previous location ---
at System.Diagnostics.Tests.ProcessThreadTests.TestStartTimeProperty() in /_/src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.cs:line 148
--- End of stack trace from previous location ---
Known issue validation
Build: :mag_right: https://dev.azure.com/dnceng-public/public/_build/results?buildId=707064
Error message validated: [ProcessThreadTests.TestStartTimeProperty]
Result validation: :white_check_mark: Known issue matched with the provided build.
Validation performed at: 6/13/2024 10:08:56 PM UTC
Report
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 1 | 2 | 11 |
Tagging subscribers to this area: @dotnet/area-system-diagnostics-process See info in area-owners.md if you want to be subscribed.
Marking as runtime-mono as all failing legs are net9.0-linux-Debug-x64-Mono_Interpreter_Debug or net9.0-linux-Release-x64-Mono_Minijit_Release.
Increasing the tolerance for just those configurations is probably reasonable.
@danmoseley this may be an actual bug in Process.Threads in mono. Looking at the failing code: It is spawning a new thread with StartNew. It is then taking the last thread in p.Threads then checking that the thread's StartTime is close to a timestamp form when the test started (curTime). https://github.com/dotnet/runtime/blob/8e6df8de0266f7dc6befeaf9daf14d565fbc0b16/src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.cs#L148-L160
As per the error:
Assert.InRange() Failure: Value not in range
Range: (2024-06-13T19:52:03.7272386Z - 2024-06-13T19:52:07.7320077Z)
Actual: 2024-06-13T19:51:56.0017534Z
the Actual value is way off in the past (9 secs.), I would expect the tolerance to be there for when the new thread is way long in the future. I think this may be taking a wrong thread instead.
I think this may be taking a wrong thread instead.
I've changed #104972 to get the current thread by matching the ID. PTAL @Jozkee