未验证 提交 45f5046f 编写于 作者: D Dan Moseley 提交者: GitHub

Increase timeout on regex count test (#67256)

* Increase timeout on regex count test

* make it 30
上级 0eccdba3
......@@ -119,7 +119,7 @@ public async Task Count_Timeout_ThrowsAfterTooLongExecution(RegexEngine engine)
Stopwatch sw = Stopwatch.StartNew();
Assert.Throws<RegexMatchTimeoutException>(() => r.Count(Input));
Assert.Throws<RegexMatchTimeoutException>(() => r.Count(Input.AsSpan()));
Assert.InRange(sw.Elapsed.TotalSeconds, 0, 10); // arbitrary upper bound that should be well above what's needed with a 1ms timeout
Assert.InRange(sw.Elapsed.TotalSeconds, 0, 30); // arbitrary upper bound that should be well above what's needed with a 1ms timeout
switch (engine)
{
......@@ -128,7 +128,7 @@ public async Task Count_Timeout_ThrowsAfterTooLongExecution(RegexEngine engine)
sw = Stopwatch.StartNew();
Assert.Throws<RegexMatchTimeoutException>(() => Regex.Count(Input, Pattern, RegexHelpers.OptionsFromEngine(engine), TimeSpan.FromMilliseconds(1)));
Assert.Throws<RegexMatchTimeoutException>(() => Regex.Count(Input.AsSpan(), Pattern, RegexHelpers.OptionsFromEngine(engine), TimeSpan.FromMilliseconds(1)));
Assert.InRange(sw.Elapsed.TotalSeconds, 0, 10); // arbitrary upper bound that should be well above what's needed with a 1ms timeout
Assert.InRange(sw.Elapsed.TotalSeconds, 0, 30); // arbitrary upper bound that should be well above what's needed with a 1ms timeout
break;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册