Skip to content

Commit

Permalink
2009-09-05 Zoltan Varga <vargaz@gmail.com>
Browse files Browse the repository at this point in the history
	* process-stress.cs: New stress test for spawning processes.

svn path=/trunk/mono/; revision=141380
  • Loading branch information
vargaz committed Sep 5, 2009
1 parent c6557b0 commit d37904d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
4 changes: 4 additions & 0 deletions 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.
Expand Down
3 changes: 2 additions & 1 deletion mono/tests/Makefile.am
Expand Up @@ -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 \
Expand Down
32 changes: 32 additions & 0 deletions 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.