Revert "[Process] Add stress tests"
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Sat, 13 Feb 2016 00:15:55 +0000 (01:15 +0100)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Sat, 13 Feb 2016 00:17:35 +0000 (01:17 +0100)
This reverts commit a7955a93f5d063feadb4198d8a6f142d81373b79.

The Process import commit was reverted in f74f7037195fe81396edde11c57cea3ec16f03fd,
this reverts the added tests as well since they fail on Jenkins now.

mono/tests/Makefile.am
mono/tests/process-stress-1.cs [deleted file]
mono/tests/process-stress-2.cs [deleted file]
mono/tests/process-stress-3.cs [deleted file]

index 6aec66bdc099a083525f98a8a184598133e0947a..169a9e24c31e9c65ee75b0595c5d4d226bad6ded 100644 (file)
@@ -1,7 +1,6 @@
 SUBDIRS = assemblyresolve gc-descriptors
 
-check-local: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test-cattr-type-load test-reflection-load-with-context test_platform     \
-                test-console-output test-messages test-env-options test-unhandled-exception-2 test-appdomain-unload test-process-stress rm-empty-logs
+check-local: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test-cattr-type-load test-reflection-load-with-context test_platform test-process-exit test-console-output test-messages test-env-options test-unhandled-exception-2 test-appdomain-unload rm-empty-logs
 check-full: test-sgen check-local
 check-parallel: compile-tests check-full
 
@@ -1409,14 +1408,6 @@ test-console-output: console-output.exe
        @diff -w console-output.exe.stdout $(srcdir)/console-output.exe.stdout.expected \
                && diff -w console-output.exe.stderr $(srcdir)/console-output.exe.stderr.expected
 
-PROCESS_STRESS_TESTS=  \
-               process-stress-1.exe    \
-               process-stress-2.exe    \
-               process-stress-3.exe
-
-test-process-stress: $(PROCESS_STRESS_TESTS) test-runner.exe
-       $(RUNTIME) ./test-runner.exe --testsuite-name $@ $(PROCESS_STRESS_TESTS)
-
 coreclr-gcstress:
        $(MAKE) -C $(mono_build_root)/acceptance-tests coreclr-gcstress
 
diff --git a/mono/tests/process-stress-1.cs b/mono/tests/process-stress-1.cs
deleted file mode 100644 (file)
index 97d3569..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-
-using System;
-using System.Diagnostics;
-using System.Threading;
-using System.Threading.Tasks;
-
-class Driver
-{
-       static void Main ()
-       {
-               for (int i = 0; i < 1000; ++i) {
-                       ProcessStartInfo psi = new ProcessStartInfo () {
-                               FileName = "echo",
-                               Arguments = "hello 1>/dev/null",
-                       };
-
-                       Process p = Process.Start (psi);
-
-                       ManualResetEvent mre = new ManualResetEvent (false);
-
-                       Task t = Task.Run (() => {
-                               mre.Set ();
-                               if (!p.WaitForExit (1000))
-                                       Environment.Exit (1);
-                       });
-
-                       if (!mre.WaitOne (1000))
-                               Environment.Exit (2);
-                       if (!p.WaitForExit (1000))
-                               Environment.Exit (3);
-
-                       if (!t.Wait (1000))
-                               Environment.Exit (4);
-               }
-       }
-}
diff --git a/mono/tests/process-stress-2.cs b/mono/tests/process-stress-2.cs
deleted file mode 100644 (file)
index d31e23a..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-
-using System;
-using System.Diagnostics;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-
-class Driver
-{
-       static void Main ()
-       {
-               Action<Process>[] tests = new Action<Process> [] {
-                       new Action<Process> (Test1),
-                       new Action<Process> (Test2),
-               };
-
-               ProcessStartInfo psi = new ProcessStartInfo () {
-                       FileName = "echo",
-                       Arguments = "hello",
-                       UseShellExecute = false,
-                       RedirectStandardOutput = true,
-               };
-
-               foreach (Action<Process> test in tests) {
-                       for (int i = 0; i < 500; ++i) {
-                               test (new Process () { StartInfo = psi });
-                       }
-               }
-       }
-
-       static void Test1 (Process p)
-       {
-               StringBuilder sb = new StringBuilder ();
-               ManualResetEvent mre_exit = new ManualResetEvent (false);
-               ManualResetEvent mre_output = new ManualResetEvent (false);
-
-               p.EnableRaisingEvents = true;
-               p.Exited += (s, a) => mre_exit.Set ();
-
-               p.Start ();
-
-               p.OutputDataReceived += (s, a) => {
-                       if (a.Data == null) {
-                               mre_output.Set ();
-                               return;
-                       }
-                       sb.Append (a.Data);
-               };
-
-               p.BeginOutputReadLine ();
-
-               if (!mre_exit.WaitOne (1000))
-                       Environment.Exit (1);
-               if (!mre_output.WaitOne (1000))
-                       Environment.Exit (2);
-
-               if (sb.ToString () != "hello") {
-                       Console.WriteLine ("process output = '{0}'", sb.ToString ());
-                       Environment.Exit (3);
-               }
-       }
-
-       static void Test2 (Process p)
-       {
-               StringBuilder sb = new StringBuilder ();
-               ManualResetEvent mre_output = new ManualResetEvent (false);
-
-               p.Start ();
-
-               p.OutputDataReceived += (s, a) => {
-                       if (a.Data == null) {
-                               mre_output.Set ();
-                               return;
-                       }
-
-                       sb.Append (a.Data);
-               };
-
-               p.BeginOutputReadLine ();
-
-               if (!p.WaitForExit (1000))
-                       Environment.Exit (4);
-               if (!mre_output.WaitOne (1000))
-                       Environment.Exit (5);
-
-               if (sb.ToString () != "hello") {
-                       Console.WriteLine ("process output = '{0}'", sb.ToString ());
-                       Environment.Exit (6);
-               }
-       }
-}
diff --git a/mono/tests/process-stress-3.cs b/mono/tests/process-stress-3.cs
deleted file mode 100644 (file)
index 7b45a3e..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-
-using System;
-using System.Diagnostics;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-
-class Driver
-{
-       static void Main ()
-       {
-               Action<Process>[] tests = new Action<Process> [] {
-                       new Action<Process> (Test1),
-                       new Action<Process> (Test2),
-               };
-
-               ProcessStartInfo psi = new ProcessStartInfo () {
-                       FileName = "find",
-                       Arguments = "/ -maxdepth 4",
-                       UseShellExecute = false,
-                       RedirectStandardOutput = true,
-                       RedirectStandardError = true,
-               };
-
-               foreach (Action<Process> test in tests) {
-                       for (int i = 0; i < 200; ++i) {
-                               test (new Process () { StartInfo = psi });
-                       }
-               }
-       }
-
-       static void Test1 (Process p)
-       {
-               ManualResetEvent mre_exit = new ManualResetEvent (false);
-               ManualResetEvent mre_output = new ManualResetEvent (false);
-               ManualResetEvent mre_error = new ManualResetEvent (false);
-
-               p.EnableRaisingEvents = true;
-               p.Exited += (s, a) => mre_exit.Set ();
-
-               p.Start ();
-
-               p.OutputDataReceived += (s, a) => {
-                       if (a.Data == null) {
-                               mre_output.Set ();
-                               return;
-                       }
-               };
-
-               p.ErrorDataReceived += (s, a) => {
-                       if (a.Data == null) {
-                               mre_error.Set ();
-                               return;
-                       }
-               };
-
-               p.BeginOutputReadLine ();
-               p.BeginErrorReadLine ();
-
-               if (!mre_exit.WaitOne (10000))
-                       Environment.Exit (1);
-               if (!mre_output.WaitOne (1000))
-                       Environment.Exit (2);
-               if (!mre_error.WaitOne (1000))
-                       Environment.Exit (3);
-       }
-
-       static void Test2 (Process p)
-       {
-               ManualResetEvent mre_output = new ManualResetEvent (false);
-               ManualResetEvent mre_error = new ManualResetEvent (false);
-
-               p.Start ();
-
-               p.OutputDataReceived += (s, a) => {
-                       if (a.Data == null) {
-                               mre_output.Set ();
-                               return;
-                       }
-               };
-
-               p.ErrorDataReceived += (s, a) => {
-                       if (a.Data == null) {
-                               mre_error.Set ();
-                               return;
-                       }
-               };
-
-               p.BeginOutputReadLine ();
-               p.BeginErrorReadLine ();
-
-               if (!p.WaitForExit (10000))
-                       Environment.Exit (4);
-               if (!mre_output.WaitOne (1000))
-                       Environment.Exit (5);
-               if (!mre_error.WaitOne (1000))
-                       Environment.Exit (6);
-       }
-}