Skip to content
Browse files

2009-09-05 Zoltan Varga <vargaz@gmail.com>

	* process-stress.cs: New stress test for spawning processes.

svn path=/trunk/mono/; revision=141380
  • Loading branch information...
1 parent c6557b0 commit d37904d5349692b54dce723940f15328fd484c8f @vargaz vargaz committed Sep 5, 2009
Showing with 38 additions and 1 deletion.
  1. +4 −0 mono/tests/ChangeLog
  2. +2 −1 mono/tests/Makefile.am
  3. +32 −0 mono/tests/process-stress.cs
View
4 mono/tests/ChangeLog
@@ -1,3 +1,7 @@
+2009-09-05 Zoltan Varga <vargaz@gmail.com>
+
+ * process-stress.cs: New stress test for spawning processes.
+
2009-09-03 Zoltan Varga <vargaz@gmail.com>
* pinvoke3.cs libtest.c: Add a test for #481559.
View
3 mono/tests/Makefile.am
@@ -44,7 +44,8 @@ STRESS_TESTS_SRC= \
monitor-stress.cs \
thread-stress.cs \
gc-stress.cs \
- exit-stress.cs
+ exit-stress.cs \
+ process-stress.cs
BASE_TEST_CS_SRC= \
array-init.cs \
View
32 mono/tests/process-stress.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Diagnostics;
+
+public class Tests
+{
+ static int iterations = 512;
+
+ public static void Main(string[] args) {
+ if (args.Length > 0)
+ iterations = Int32.Parse (args [0]);
+
+ // Spawn threads without waiting for them to exit
+ for (int i = 0; i < iterations; i++) {
+ Console.Write (".");
+ //Console.WriteLine("Starting: " + i.ToString());
+ using (var p = System.Diagnostics.Process.Start("echo -n")) {
+ System.Threading.Thread.Sleep(10);
+ }
+ }
+
+ // Spawn threads and wait for them to exit
+ for (int i = 0; i < iterations; i++) {
+ Console.Write (".");
+ //Console.WriteLine("Starting: " + i.ToString());
+ using (var p = System.Diagnostics.Process.Start("echo -n")) {
+ p.WaitForExit ();
+ }
+ }
+
+ Console.WriteLine ();
+ }
+}

0 comments on commit d37904d

Please sign in to comment.
Something went wrong with that request. Please try again.