diff options
Diffstat (limited to 'plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java')
-rw-r--r-- | plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java index 749a08e58..36ad4d47b 100644 --- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java +++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java @@ -477,19 +477,26 @@ class TestRCBP1 implements ITCFTest, RunControl.DiagnosticTestDone, IRunControl. private void startTestContext() { srv_diag.runTest(test_id, new IDiagnostics.DoneRunTest() { - public void doneRunTest(IToken token, Throwable error, String context_id) { + public void doneRunTest(IToken token, Throwable error, final String context_id) { if (error != null) { exit(error); } - else if (test_suite.isActive(TestRCBP1.this)) { - assert test_ctx_id == null; - test_ctx_id = context_id; - if (pending_cancel != null) { - exit(null); - } - else { - runTest(); - } + else { + // sync() is needed to resolve ambiguity if target re-uses test context IDs + Protocol.sync(new Runnable() { + @Override + public void run() { + if (!test_suite.isActive(TestRCBP1.this)) return; + assert test_ctx_id == null; + test_ctx_id = context_id; + if (pending_cancel != null) { + exit(null); + } + else { + runTest(); + } + } + }); } } }); |