Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/MockProcess.java21
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/RuntimeProcessTests.java6
2 files changed, 19 insertions, 8 deletions
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/MockProcess.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/MockProcess.java
index 992a0c3a6..c615cb40b 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/MockProcess.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/MockProcess.java
@@ -178,14 +178,19 @@ public class MockProcess extends Process {
@Override
public int read() throws IOException {
if (processState == ProcessState.LASTREAD) {
-
- // Uncomment this sleep and the test will fail because
- // RuntimeProcess.terminate does not wait until
- // the monitor threads complete.
- // try {
- // Thread.sleep(1000);
- // } catch (InterruptedException e) {
- // }
+ /*
+ * This sleep makes
+ * RuntimeProcessTests.testOutputAfterDestroy() fail because
+ * RuntimeProcess.terminate does not wait until the monitor
+ * threads completes. The sleep here just helps amplify a
+ * the thread scheduling decision that otherwise makes
+ * testOutputAfterDestroy unstable (as reported in Bug
+ * 577185)
+ */
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ }
processState = ProcessState.TERMINATED;
return ProcessState.LASTREAD.getCode();
}
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/RuntimeProcessTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/RuntimeProcessTests.java
index c29a24984..df9807334 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/RuntimeProcessTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/RuntimeProcessTests.java
@@ -37,6 +37,7 @@ import org.eclipse.debug.internal.core.DebugCoreMessages;
import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.debug.tests.TestUtil;
import org.eclipse.debug.tests.sourcelookup.TestLaunch;
+import org.junit.Ignore;
import org.junit.Test;
public class RuntimeProcessTests extends AbstractDebugTest {
@@ -212,7 +213,12 @@ public class RuntimeProcessTests extends AbstractDebugTest {
assertThat(timeoutException.getMessage(), is(DebugCoreMessages.RuntimeProcess_terminate_failed));
}
+ /**
+ * See comment in MockProcess.MockProcess().new InputStream() {...}.read()
+ * for why this test fails
+ */
@Test
+ @Ignore("See https://bugs.eclipse.org/bugs/show_bug.cgi?id=577189")
public void testOutputAfterDestroy() throws Exception {
MockProcess proc = new MockProcess();

Back to the top