Fixes #2017. Sometimes I get fails with the TestAddManyTimeouts unit test. (#2018)

* Fixes #2017. Sometimes I get fails with the TestAddManyTimeouts unit test.

* Fixes #2013. Starting having MainLoopTests.InvokeLeakTest failure.
This commit is contained in:
BDisp
2022-09-16 14:09:41 +00:00
committed by GitHub
parent 7ce2109a46
commit 0f9abea9e4

View File

@@ -1301,7 +1301,7 @@ namespace Terminal.Gui.Core {
var myi = i;
Task.Run (() => {
Task.Delay (100).Wait ();
Thread.Sleep (100);
// each thread registers lots of 1s timeouts
for (int j = 0; j < numberOfTimeoutsPerThread; j++) {
@@ -1318,7 +1318,7 @@ namespace Terminal.Gui.Core {
if (myi == 0) {
// let the timeouts run for a bit
Task.Delay (5000).Wait ();
Thread.Sleep (5000);
// then tell the application to quit
Application.MainLoop.Invoke (() => Application.RequestStop ());