Browse Source

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.
BDisp 2 years ago
parent
commit
0f9abea9e4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      UnitTests/ApplicationTests.cs

+ 2 - 2
UnitTests/ApplicationTests.cs

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