Skip to content

Commit

Permalink
Improve error message and add cleanup in LaunchConfigurationTest ecli…
Browse files Browse the repository at this point in the history
…pse-platform#582

Perform proper cleanup in test case testNullLaunchConfigurationInLaunch
by removing created launch. Add further debug output in random failing
test case testTerminateTimeStamp.

Contributes to
eclipse-platform#582
  • Loading branch information
HeikoKlare committed Jul 26, 2023
1 parent 31a41a6 commit f1c95af
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1359,13 +1359,14 @@ public void launchesTerminated(ILaunch[] launches) {
}
};
DebugPlugin.getDefault().getLaunchManager().addLaunchListener(listener);
ILaunch launch = workingCopy.launch(ILaunchManager.DEBUG_MODE, null);
final ILaunch launch = workingCopy.launch(ILaunchManager.DEBUG_MODE, null);
IProcess process = null;
try {
process = DebugPlugin.newProcess(launch, new MockProcess(0), "test-terminate-timestamp");
final IProcess finalProcess = process;
waitWhile(__ -> !terminatedLaunches.contains(launch), testTimeout,
__ -> "Launch termination event did not occur and termination state of launched process is: " + finalProcess.isTerminated());
__ -> "Launch termination event did not occur: "+
"launch termination state is \"" + launch.isTerminated() + "\" " +
"and " + terminatedLaunches.size() + " launches have terminated");
String launchTerminateTimestampUntyped = launch.getAttribute(DebugPlugin.ATTR_TERMINATE_TIMESTAMP);
assertNotNull("Time stamp is missing", launchTerminateTimestampUntyped);
long launchTerminateTimestamp = Long.parseLong(launchTerminateTimestampUntyped);
Expand Down Expand Up @@ -1764,6 +1765,8 @@ public void testNullLaunchConfigurationInLaunch() throws Exception {
}
// no NPE should be logged
lm.addLaunch(l);
// Clean up by removing launch again
lm.removeLaunch(l);
}

/**
Expand Down

0 comments on commit f1c95af

Please sign in to comment.