mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 09:25:31 +02:00
Neglected to spin off the service call in getProcessContext() on the dsf executor
This commit is contained in:
parent
cbdc8d81d3
commit
da04759802
2 changed files with 43 additions and 30 deletions
|
@ -192,21 +192,28 @@ public class GDBProcessesTest extends BaseTestCase {
|
|||
|
||||
final AsyncCompletionWaitor waitor = new AsyncCompletionWaitor();
|
||||
|
||||
fProcService.getProcessesBeingDebugged(fGdbCtrl.getContext(), new DataRequestMonitor<IDMContext[]>(fSession.getExecutor(), null) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
IDMContext[] contexts = getData();
|
||||
Assert.assertNotNull("invalid return value from service", contexts);
|
||||
Assert.assertEquals("unexpected number of processes", contexts.length, 1);
|
||||
IDMContext context = contexts[0];
|
||||
IProcessDMContext processContext = DMContexts.getAncestorOfType(context, IProcessDMContext.class);
|
||||
Assert.assertNotNull("unexpected process context type ", processContext);
|
||||
waitor.setReturnInfo(processContext);
|
||||
}
|
||||
fProcService.getExecutor().submit(new Runnable() {
|
||||
public void run() {
|
||||
fProcService.getProcessesBeingDebugged(fGdbCtrl.getContext(), new DataRequestMonitor<IDMContext[]>(fSession.getExecutor(), null) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
IDMContext[] contexts = getData();
|
||||
Assert.assertNotNull("invalid return value from service", contexts);
|
||||
Assert.assertEquals("unexpected number of processes", contexts.length, 1);
|
||||
IDMContext context = contexts[0];
|
||||
IProcessDMContext processContext = DMContexts.getAncestorOfType(context, IProcessDMContext.class);
|
||||
Assert.assertNotNull("unexpected process context type ", processContext);
|
||||
waitor.setReturnInfo(processContext);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
waitor.waitUntilDone(TestsPlugin.massageTimeout(2000));
|
||||
Assert.assertTrue(fWait.getMessage(), fWait.isOK());
|
||||
|
|
|
@ -186,24 +186,30 @@ public class MIRunControlTest extends BaseTestCase {
|
|||
@ThreadSafeAndProhibitedFromDsfExecutor("fSession.getExecutor()")
|
||||
private IProcessDMContext getProcessContext() throws InterruptedException {
|
||||
assert !fRunCtrl.getExecutor().isInExecutorThread();
|
||||
|
||||
final AsyncCompletionWaitor waitor = new AsyncCompletionWaitor();
|
||||
|
||||
fProcService.getProcessesBeingDebugged(fGDBCtrl.getContext(), new DataRequestMonitor<IDMContext[]>(fRunCtrl.getExecutor(), null) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
IDMContext[] contexts = getData();
|
||||
Assert.assertNotNull("invalid return value from service", contexts);
|
||||
Assert.assertEquals("unexpected number of processes", contexts.length, 1);
|
||||
IDMContext context = contexts[0];
|
||||
IProcessDMContext processContext = DMContexts.getAncestorOfType(context, IProcessDMContext.class);
|
||||
Assert.assertNotNull("unexpected process context type ", processContext);
|
||||
waitor.setReturnInfo(processContext);
|
||||
}
|
||||
final AsyncCompletionWaitor waitor = new AsyncCompletionWaitor();
|
||||
|
||||
fRunCtrl.getExecutor().submit(new Runnable() {
|
||||
public void run() {
|
||||
fProcService.getProcessesBeingDebugged(fGDBCtrl.getContext(), new DataRequestMonitor<IDMContext[]>(fRunCtrl.getExecutor(), null) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
IDMContext[] contexts = getData();
|
||||
Assert.assertNotNull("invalid return value from service", contexts);
|
||||
Assert.assertEquals("unexpected number of processes", contexts.length, 1);
|
||||
IDMContext context = contexts[0];
|
||||
IProcessDMContext processContext = DMContexts.getAncestorOfType(context, IProcessDMContext.class);
|
||||
Assert.assertNotNull("unexpected process context type ", processContext);
|
||||
waitor.setReturnInfo(processContext);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
waitor.waitUntilDone(TestsPlugin.massageTimeout(2000));
|
||||
Assert.assertTrue(waitor.getMessage(), waitor.isOK());
|
||||
|
|
Loading…
Add table
Reference in a new issue