diff options
author | Ludovic Henry <ludovic@xamarin.com> | 2017-02-22 02:42:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-22 02:42:42 +0300 |
commit | f8f323d671b2528110c552b7f42ce53bf6846acd (patch) | |
tree | 6028a9217c02ef31704222cd09a613e41d7119b4 /mcs/class/System/Test | |
parent | 4c4176ac3f1d4b5c256d5ffc57023af582072a80 (diff) |
[Process] Fix NonChildProcessWaitForExit Exited callback (#4409)
Diffstat (limited to 'mcs/class/System/Test')
-rw-r--r-- | mcs/class/System/Test/System.Diagnostics/ProcessTest.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mcs/class/System/Test/System.Diagnostics/ProcessTest.cs b/mcs/class/System/Test/System.Diagnostics/ProcessTest.cs index 5db7246a4bd..cb3827785af 100644 --- a/mcs/class/System/Test/System.Diagnostics/ProcessTest.cs +++ b/mcs/class/System/Test/System.Diagnostics/ProcessTest.cs @@ -1139,13 +1139,15 @@ namespace MonoTests.System.Diagnostics Assert.Ignore ("accessing parent pid, only available on unix"); using (Process process = Process.GetProcessById (getppid ())) + using (ManualResetEvent mre = new ManualResetEvent (false)) { Assert.IsFalse (process.WaitForExit (10), "#1"); Assert.IsFalse (process.HasExited, "#2"); Assert.Throws<InvalidOperationException>(delegate { int exitCode = process.ExitCode; }, "#3"); - process.Exited += (s, e) => Assert.Fail ("#4"); + process.Exited += (s, e) => mre.Set (); process.EnableRaisingEvents = true; + Assert.IsFalse (mre.WaitOne (100), "#4"); Assert.IsFalse (process.WaitForExit (10), "#5"); Assert.IsFalse (process.HasExited, "#6"); |