vitruv-tools / Vitruv-DSLs

Languages for Specifying Consistency Preservation Rules
Eclipse Public License 1.0
2 stars 4 forks source link

Fix Commonalities UI tests race condition #74

Open JanWittler opened 2 years ago

JanWittler commented 2 years ago

In the Commonalities UI tests, in the class MissingBundlesQuickfixTest.xtend, the test fixMissingRuntimeBundle contains a race condition. More specifically, after modifying a plugin project using the asynchronous apply method, it is not waited until the specific marker file is written. Thus, to resolve the issue, apply should be called using a progress monitor and test execution should only continue after the monitor's done method is called. However, as of 13/10/22, the done method is never called due to an internal bug. As such, currently the workaround of waiting 200ms after calling the apply method is applied (in #71). As soon as the bug is resolved by the Eclipse community, the workaround should be replaced by a proper implementation. An example solution to the problem could look like this

Semaphore semaphore = new Semaphore(0);
pluginProject.apply(new NullProgressMonitor() {
  public void done() {
    semaphore.release();
  }         
});
semaphore.acquire();

The same workaround was also applied to ProjectQuickfix.xtend.

JanWittler commented 2 years ago

~Eclipse Bug Report: https://bugs.eclipse.org/bugs/show_bug.cgi?id=580922~ GitHub Issue: https://github.com/eclipse-pde/eclipse.pde/issues/365