From 735bde81579fa8d1fc05be58b4fe4b8aa84bb585 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Tue, 16 Sep 2014 06:53:15 -0400 Subject: [PATCH] Bug 444196 - Add delay before deleting breakpoint We are getting intermittend failures on the GDBConsoleBreakpointsTest due to the fact that we create and then try to delete a breakpoint so fast that the MIBreakpointsManager does not have enough time to update its data structures. This is something specific to automated tests, as a user won't be able to delete a breakpoint so fast. Change-Id: I4b220cc859b7ee45e1b8dbde0edbcaa38b9dfe34 Signed-off-by: Marc Khouzam Reviewed-on: https://git.eclipse.org/r/33432 Tested-by: Hudson CI Reviewed-by: Alvaro Sanchez-Leon --- .../tests/dsf/gdb/tests/GDBConsoleBreakpointsTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBConsoleBreakpointsTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBConsoleBreakpointsTest.java index 171f9691b26..cb791e4916c 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBConsoleBreakpointsTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBConsoleBreakpointsTest.java @@ -322,6 +322,14 @@ public class GDBConsoleBreakpointsTest extends BaseTestCase { Assert.assertTrue(miBpts.length == 1); waitForBreakpointEvent(IBreakpointsAddedEvent.class); Assert.assertTrue(getPlatformBreakpointCount() == 1); + + // Give a little delay to allow queued Executor operations + // to complete before deleting the breakpoint again. + // If we don't we may delete it so fast that the MIBreakpointsManager + // has not yet updated its data structures + // Bug 438934 comment 10 + Thread.sleep(500); + plBpt = findPlatformBreakpoint(type, attributes); Assert.assertTrue(plBpt instanceof CBreakpoint); if (!miBpts[0].isPending()) {