Skip to content

Commit 5d99b30

Browse files
Bug #88329. [Core] Scheduler awaits "Start at" timeout for global step disabled in "Update steps" dialog
Change-Id: I8739903e29e76e8a3d23ffe68e024d835e1ad286
1 parent 0d05d73 commit 5d99b30

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

clearth-core/src/main/java/com/exactprosystems/clearth/automation/SchedulerUpdater.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/******************************************************************************
2-
* Copyright 2009-2024 Exactpro Systems Limited
2+
* Copyright 2009-2025 Exactpro Systems Limited
33
* https://www.exactpro.com
44
* Build Software to Test Software
55
*
@@ -171,6 +171,7 @@ private void applyUpdatedSteps(List<StepData> updatedSteps, Map<String, Step> ex
171171
logger.debug("Updating startup fields: Execute={}, Start at={}, Kind={}",
172172
step.isExecute(), step.getStartAt(), step.getKind());
173173
existingStep.setExecute(step.isExecute());
174+
existingStep.refreshExecutableFlag();
174175
existingStep.setStartAt(step.getStartAt());
175176
existingStep.setKind(step.getKind());
176177
}

clearth-core/src/main/java/com/exactprosystems/clearth/automation/Step.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,13 +606,18 @@ public void clearSyncActions()
606606
{
607607
actions.clear();
608608
}
609-
609+
610+
public void refreshExecutableFlag()
611+
{
612+
executable = stepData.isExecute() && !actions.isEmpty() && actions.stream().anyMatch(Action::isExecutable);
613+
}
614+
610615
public void setActions(List<Action> actions)
611616
{
612617
clearActions();
613618
this.actions.addAll(actions);
614619
asyncActions.clear();
615-
executable = stepData.isExecute() && !actions.isEmpty() && actions.stream().anyMatch(Action::isExecutable);
620+
refreshExecutableFlag();
616621
async = false;
617622

618623
if (actionsIterator != null)

clearth-core/src/test/java/com/exactprosystems/clearth/automation/SchedulerUpdaterTest.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,18 @@ public void updateSteps() throws ClearThException, AutomationException, Schedule
222222
{
223223
ApplicationManager.waitForSchedulerToSuspend(scheduler, 100, 2000);
224224

225-
List<String> originalSteps = getStepNames(scheduler.getSteps());
225+
List<Step> originalSteps = scheduler.getSteps();
226+
List<String> originalStepNames = getStepNames(originalSteps);
226227

227228
SchedulerUpdater updater = new SchedulerUpdater(scheduler);
228229
updater.updateSteps(List.of(
229-
createStepData("Step1", true, true, false), //"Ask for continue" = true
230-
createStepData("Step2", false, false, false), //Execute = false
231-
createStepData("Step3", true, false, false), //"Ask for continue" = false
232-
createStepData("Step4", true, false, true))); //"Ask if failed" = true
230+
createStepData("Step1", true, true, false, originalSteps.get(0).getStartAt()), //"Ask for continue" = true
231+
createStepData("Step2", false, false, false, originalSteps.get(1).getStartAt()), //Execute = false
232+
createStepData("Step3", true, false, false, originalSteps.get(2).getStartAt()), //"Ask for continue" = false
233+
createStepData("Step4", true, false, true, originalSteps.get(3).getStartAt()))); //"Ask if failed" = true
233234

234235
List<String> newSteps = getStepNames(scheduler.getSteps());
235-
Assert.assertEquals(newSteps, originalSteps, "Steps list"); //Updater should not remove nor add any steps
236+
Assert.assertEquals(newSteps, originalStepNames, "Steps list"); //Updater should not remove nor add any steps
236237

237238
scheduler.continueExecution();
238239
ApplicationManager.waitForSchedulerToSuspend(scheduler, 100, 2000);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Global step,Step kind,Start at,Start at type,Wait next day,Parameter,Ask for continue,Ask if failed,Execute,Comment
22
Step1,Default,,End of previous step,0,,0,0,1,
3-
Step2,Default,,End of previous step,0,,0,0,1,
3+
Step2,Default,+00:00:30,End of previous step,0,,0,0,1,
44
Step3,Default,,End of previous step,0,,1,0,1,
55
Step4,Default,,End of previous step,0,,0,0,1,

0 commit comments

Comments
 (0)