Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2021-11-10 14:47:57 +0000
committerAndrey Loskutov2021-11-10 14:59:57 +0000
commitb703e4db3c9ed4e049a713c182b2d9417eb58e6e (patch)
treec6a4985f042613100b56018fef65e0db04176de9
parenta8b1a4953b7317fc4d3a5e6ed1acd1b5c3121346 (diff)
downloadeclipse.platform.debug-S4_22_0_M3.tar.gz
eclipse.platform.debug-S4_22_0_M3.tar.xz
eclipse.platform.debug-S4_22_0_M3.zip
Bug 577189 has been raised to cover fixing this issue, and the test has been modified so that it fails very consistently. Change-Id: Ia288495158f5498e3e8ba530d544e10ac1e2d209 Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.debug/+/187593 Tested-by: Andrey Loskutov <loskutov@gmx.de> Reviewed-by: Andrey Loskutov <loskutov@gmx.de>
-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