diff options
author | Jonah Graham | 2021-11-10 14:47:57 +0000 |
---|---|---|
committer | Andrey Loskutov | 2021-11-10 14:59:57 +0000 |
commit | b703e4db3c9ed4e049a713c182b2d9417eb58e6e (patch) | |
tree | c6a4985f042613100b56018fef65e0db04176de9 | |
parent | a8b1a4953b7317fc4d3a5e6ed1acd1b5c3121346 (diff) | |
download | eclipse.platform.debug-b703e4db3c9ed4e049a713c182b2d9417eb58e6e.tar.gz eclipse.platform.debug-b703e4db3c9ed4e049a713c182b2d9417eb58e6e.tar.xz eclipse.platform.debug-b703e4db3c9ed4e049a713c182b2d9417eb58e6e.zip |
Bug 577185: @Ignore unstable testS4_22_0_M3I20211114-1800I20211114-0600I20211113-1800I20211113-0600I20211112-2030I20211111-0910I20211110-1800
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.java | 21 | ||||
-rw-r--r-- | org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/RuntimeProcessTests.java | 6 |
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(); |