[tests] Add stress testing and reduce sgen normal testing time (#4653)
[mono.git] / mono / tests / sgen-new-threads-dont-join-stw.cs
index b6d0a9b693b87a557298e60566528b2934ef5bf4..12750c6608962d495a1dfa9eba08d4caeca0e1b5 100644 (file)
@@ -44,8 +44,9 @@ class T {
     }
 
     static void Main (string[] args) {
-        
-        for (int j = 0; j < 2; j++)
+        int iterations = 0;
+
+        for (TestTimeout timeout = TestTimeout.Start(TimeSpan.FromSeconds(TestTimeout.IsStressTest ? 60 : 1)); timeout.HaveTimeLeft;)
         {
             count = 0;
 
@@ -82,6 +83,7 @@ class T {
             {
                 while (count < num_threads)
                 {
+                    Console.Write (".");
                     Monitor.Wait(count_lock);
                 }
             }
@@ -90,6 +92,11 @@ class T {
             {
                 t.Join();
             }
+
+            Console.WriteLine ();
+            iterations += 1;
         }
+
+        Console.WriteLine ($"done {iterations} iterations");
     }
 }