Skip to content
Snippets Groups Projects
Commit 5b9169e7 authored by Nelson Tavares de Sousa's avatar Nelson Tavares de Sousa
Browse files

removed bug that didn't let the analysis terminate

parent 619ab59d
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,7 @@ abstract class AbstractRunnableStage implements Runnable {
} while (!stage.shouldBeTerminated());
} catch (StageException e) {
this.stage.terminate();
failed = true;
}
afterStageExecution(stage);
......@@ -66,6 +67,7 @@ abstract class AbstractRunnableStage implements Runnable {
stage.onSignal(signal, inputPorts[i]);
}
}
System.out.println("HELLO");
throw new IllegalStateException("Terminated by StageExceptionListener");
}
......
......@@ -22,6 +22,7 @@ import static org.junit.Assert.assertThat;
import org.junit.Test;
import teetime.framework.Analysis;
import teetime.framework.AnalysisException;
import teetime.framework.StageState;
public class ExceptionHandlingTest {
......@@ -34,14 +35,12 @@ public class ExceptionHandlingTest {
return configuration;
}
@Test
public void exceptionPassingAndTermination() {
newInstances();
analysis.executeBlocking();
assertEquals(TestListener.exceptionInvoked, 2); // listener did not kill thread to early
assertEquals(TestListener.exceptionInvoked, 2); // listener did not kill thread too early
}
@Test
public void terminatesAllStages() {
ExceptionTestConfiguration config = newInstances();
analysis.executeBlocking();
......@@ -53,8 +52,12 @@ public class ExceptionHandlingTest {
@Test
public void forAFewTimes() {
for (int i = 0; i < 100; i++) {
newInstances();
exceptionPassingAndTermination();
try {
exceptionPassingAndTermination();
terminatesAllStages();
} catch (AnalysisException e) {
// Correct behavior
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment