Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2014-05-09 03:54:43 +0000
committerEugene Tarassov2014-05-09 03:54:43 +0000
commit49edf762196ac440cd7c69233e12d207fbc51468 (patch)
tree8ab96929d6719021e93cd32c7b16ba6a266c0f5d /plugins
parentf83f4c9d2e983b6f0680fa1120b449d2b91bc5d3 (diff)
downloadorg.eclipse.tcf-49edf762196ac440cd7c69233e12d207fbc51468.tar.gz
org.eclipse.tcf-49edf762196ac440cd7c69233e12d207fbc51468.tar.xz
org.eclipse.tcf-49edf762196ac440cd7c69233e12d207fbc51468.zip
TCF Tests: fixed infrequent test failures when target re-uses test context IDs
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java27
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();
+ }
+ }
+ });
}
}
});

Back to the top