Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Moseley <danmose@microsoft.com>2018-04-05 21:24:28 +0300
committerStephen Toub <stoub@microsoft.com>2018-04-05 21:24:28 +0300
commitffb16981972bf88ba73e21f890b215fa98487f8b (patch)
treed22108e9eacd7191be533a0a74928ac7f2673221
parent4739720ad1f70c7202b870048f932a10cd0214ed (diff)
Increase window for process start time test (#28852)
-rw-r--r--src/System.Diagnostics.Process/tests/ProcessThreadTests.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/System.Diagnostics.Process/tests/ProcessThreadTests.cs b/src/System.Diagnostics.Process/tests/ProcessThreadTests.cs
index cda6074d3f..df00d40b03 100644
--- a/src/System.Diagnostics.Process/tests/ProcessThreadTests.cs
+++ b/src/System.Diagnostics.Process/tests/ProcessThreadTests.cs
@@ -90,7 +90,7 @@ namespace System.Diagnostics.Tests
[SkipOnTargetFramework(TargetFrameworkMonikers.Uap, "Retrieving information about local processes is not supported on uap")]
public async Task TestStartTimeProperty()
{
- TimeSpan allowedWindow = TimeSpan.FromSeconds(1);
+ TimeSpan allowedWindow = TimeSpan.FromSeconds(2);
using (Process p = Process.GetCurrentProcess())
{
@@ -129,7 +129,8 @@ namespace System.Diagnostics.Tests
p.Refresh();
try
{
- Assert.Contains(p.Threads.Cast<ProcessThread>(), t => t.StartTime.ToUniversalTime() >= curTime - allowedWindow);
+ 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)
{