diff --git a/tests/org.eclipse.epsilon.eol.dap.test/src/org/eclipse/epsilon/eol/dap/test/AbstractEpsilonDebugAdapterTest.java b/tests/org.eclipse.epsilon.eol.dap.test/src/org/eclipse/epsilon/eol/dap/test/AbstractEpsilonDebugAdapterTest.java index 9c7dd38e4..9172bfe58 100644 --- a/tests/org.eclipse.epsilon.eol.dap.test/src/org/eclipse/epsilon/eol/dap/test/AbstractEpsilonDebugAdapterTest.java +++ b/tests/org.eclipse.epsilon.eol.dap.test/src/org/eclipse/epsilon/eol/dap/test/AbstractEpsilonDebugAdapterTest.java @@ -146,11 +146,6 @@ public void setup() throws Exception { @After public void teardown() { adapter.disconnect(new DisconnectArguments()); - if (module != null) { - module.getContext().getModelRepository().dispose(); - module.getContext().dispose(); - module = null; - } } protected void assertStoppedBecauseOf(final String reason) throws InterruptedException { @@ -237,6 +232,10 @@ protected void runModule() { module.execute(); } catch (Throwable e) { e.printStackTrace(); + } finally { + module.getContext().getModelRepository().dispose(); + module.getContext().dispose(); + module = null; } }