Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ProcessThreadTests.TestStartTimeProperty failed in CI #103448

Closed
stephentoub opened this issue Jun 13, 2024 · 5 comments · Fixed by #104972
Closed

ProcessThreadTests.TestStartTimeProperty failed in CI #103448

stephentoub opened this issue Jun 13, 2024 · 5 comments · Fixed by #104972
Assignees
Labels
area-System.Diagnostics.Process blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab os-linux Linux OS (any supported distro) runtime-mono specific to the Mono runtime
Milestone

Comments

@stephentoub
Copy link
Member

stephentoub commented Jun 13, 2024

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: #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: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=707064
Error message validated: [ProcessThreadTests.TestStartTimeProperty]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 6/13/2024 10:08:56 PM UTC

Report

Build Definition Test Pull Request
749496 dotnet/runtime System.Diagnostics.Tests.ProcessThreadTests.TestStartTimeProperty #105209
744740 dotnet/runtime System.Diagnostics.Tests.ProcessThreadTests.TestStartTimeProperty #104972
737065 dotnet/runtime System.Diagnostics.Tests.ProcessThreadTests.TestStartTimeProperty #104437
735640 dotnet/runtime System.Diagnostics.Tests.ProcessThreadTests.TestStartTimeProperty
733347 dotnet/runtime System.Diagnostics.Tests.ProcessThreadTests.TestStartTimeProperty #104562
731358 dotnet/runtime System.Diagnostics.Tests.ProcessThreadTests.TestStartTimeProperty #104437
730106 dotnet/runtime System.Diagnostics.Tests.ProcessThreadTests.TestStartTimeProperty #104328
728232 dotnet/runtime System.Diagnostics.Tests.ProcessThreadTests.TestStartTimeProperty #103444
724651 dotnet/runtime System.Diagnostics.Tests.ProcessThreadTests.TestStartTimeProperty #104173
722132 dotnet/runtime System.Diagnostics.Tests.ProcessThreadTests.TestStartTimeProperty #103915

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
1 2 10
@stephentoub stephentoub added area-System.Diagnostics.Process blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab labels Jun 13, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jun 13, 2024
Copy link
Contributor

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

@jozkee jozkee added this to the 9.0.0 milestone Jul 11, 2024
@jozkee jozkee added os-linux Linux OS (any supported distro) runtime-mono specific to the Mono runtime and removed untriaged New issue has not been triaged by the area owner labels Jul 11, 2024
@jozkee
Copy link
Member

jozkee commented Jul 11, 2024

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.

@jozkee jozkee added the untriaged New issue has not been triaged by the area owner label Jul 11, 2024
@jozkee jozkee removed this from the 9.0.0 milestone Jul 11, 2024
@danmoseley
Copy link
Member

Increasing the tolerance for just those configurations is probably reasonable.

adamsitnik added a commit to adamsitnik/runtime that referenced this issue Jul 16, 2024
@adamsitnik adamsitnik removed the untriaged New issue has not been triaged by the area owner label Jul 16, 2024
@adamsitnik adamsitnik added this to the 9.0.0 milestone Jul 16, 2024
@adamsitnik adamsitnik self-assigned this Jul 16, 2024
@jozkee
Copy link
Member

jozkee commented Jul 16, 2024

@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).

await Task.Factory.StartNew(() =>
{
p.Refresh();
try
{
var newest = p.Threads.Cast<ProcessThread>().OrderBy(t => t.StartTime.ToUniversalTime()).Last();
Assert.InRange(newest.StartTime.ToUniversalTime(), curTime - allowedWindow, DateTime.Now.ToUniversalTime() + allowedWindow);
}
catch (InvalidOperationException)
{
// A thread may have gone away between our getting its info and attempting to access its StartTime
}
}, CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default);

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.

adamsitnik added a commit to adamsitnik/runtime that referenced this issue Jul 17, 2024
…ssThreadTests.TestStartTimeProperty test, fixes dotnet#103448"

This reverts commit 3092d86.
@adamsitnik
Copy link
Member

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

@github-actions github-actions bot locked and limited conversation to collaborators Aug 22, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
area-System.Diagnostics.Process blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab os-linux Linux OS (any supported distro) runtime-mono specific to the Mono runtime
Projects
None yet
4 participants