Skip to content
Snippets Groups Projects
Commit 5e147e14 authored by Jan Kožusznik's avatar Jan Kožusznik
Browse files

FIX: some finished tasks looks like failed

parent 8036b859
Branches
No related tags found
1 merge request!14Iss1026
...@@ -109,11 +109,10 @@ public class BenchmarkJobManager { ...@@ -109,11 +109,10 @@ public class BenchmarkJobManager {
verifiedStateProcessed = true; verifiedStateProcessed = true;
return CompletableFuture.supplyAsync(() -> { return CompletableFuture.supplyAsync(() -> {
try { try {
verifiedState = Stream verifiedState =
.concat(Arrays.asList(state).stream(), getTasks().stream() Stream.concat(Arrays.asList(state).stream(), getTasks().stream().filter(task->!task.getDescription().equals(Constants.DONE_TASK))
.flatMap(task -> task.getComputations().stream()).map(tc -> tc.getState())) .flatMap(task -> task.getComputations().stream()).map(tc -> tc.getState()))
.max(new JobStateComparator()).get(); .max(new JobStateComparator()).get();
if (verifiedState != JobState.Finished && verifiedState != JobState.Canceled) { if (verifiedState != JobState.Finished && verifiedState != JobState.Canceled) {
verifiedState = JobState.Failed; verifiedState = JobState.Failed;
} }
......
...@@ -38,7 +38,7 @@ public interface Constants { ...@@ -38,7 +38,7 @@ public interface Constants {
put("define_output", "Define output"); put("define_output", "Define output");
put("hdf5_xml_output", "Define hdf5 output"); put("hdf5_xml_output", "Define hdf5 output");
put("resave_hdf5_output", "Resave output to hdf5"); put("resave_hdf5_output", "Resave output to hdf5");
put("done", "Done"); put(DONE_TASK, "Done");
}}; }};
String STATISTICS_TASK_NAME = "Task name"; String STATISTICS_TASK_NAME = "Task name";
...@@ -51,5 +51,6 @@ public interface Constants { ...@@ -51,5 +51,6 @@ public interface Constants {
String STATISTICS_SUMMARY_FILENAME = "summary.csv"; String STATISTICS_SUMMARY_FILENAME = "summary.csv";
String SUMMARY_FILE_HEADER = "Task;AvgMemoryUsage;AvgWallTime;MaxWallTime;TotalTime;JobCount"; String SUMMARY_FILE_HEADER = "Task;AvgMemoryUsage;AvgWallTime;MaxWallTime;TotalTime;JobCount";
String DONE_TASK = "done";
} }
...@@ -14,7 +14,7 @@ public class JobStateComparator implements Comparator<JobState>{ ...@@ -14,7 +14,7 @@ public class JobStateComparator implements Comparator<JobState>{
priorities.put(state, priorities.size()); priorities.put(state, priorities.size());
} }
{ static {
Arrays.asList(JobState.Finished,JobState.Queued, JobState.Running, JobState.Canceled, JobState.Failed).forEach(state->add(state)); Arrays.asList(JobState.Finished,JobState.Queued, JobState.Running, JobState.Canceled, JobState.Failed).forEach(state->add(state));
} }
@Override @Override
......
...@@ -41,6 +41,7 @@ import javafx.scene.control.TableView; ...@@ -41,6 +41,7 @@ import javafx.scene.control.TableView;
import javafx.scene.layout.BorderPane; import javafx.scene.layout.BorderPane;
import net.imagej.updater.util.Progress; import net.imagej.updater.util.Progress;
//TASK: fix Exception during context menu request on task with N/A state
public class BenchmarkSPIMController extends BorderPane implements CloseableControl, InitiableControl { public class BenchmarkSPIMController extends BorderPane implements CloseableControl, InitiableControl {
@FXML @FXML
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment