Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Shailesh Jagannath Padave committed Nov 19, 2024
1 parent 29ac65c commit 039e8af
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public void testTaskDefInvalidEmail() {
taskDef.setName("test-task");
taskDef.setRetryCount(1);
taskDef.setTimeoutSeconds(1000);
taskDef.setTotalTimeoutSeconds(2000);
taskDef.setResponseTimeoutSeconds(1);

Set<ConstraintViolation<Object>> result = validator.validate(taskDef);
Expand All @@ -102,6 +103,7 @@ public void testTaskDefValidEmail() {
taskDef.setRetryCount(1);
taskDef.setTimeoutSeconds(1000);
taskDef.setResponseTimeoutSeconds(1);
taskDef.setTotalTimeoutSeconds(2000);
taskDef.setOwnerEmail("[email protected]");

Set<ConstraintViolation<Object>> result = validator.validate(taskDef);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void testDeepCopyTask() {
final Task task = new Task();
// In order to avoid forgetting putting inside the copy method the newly added fields check
// the number of declared fields.
final int expectedTaskFieldsNumber = 41;
final int expectedTaskFieldsNumber = 42;
final int declaredFieldsNumber = task.getClass().getDeclaredFields().length;

assertEquals(expectedTaskFieldsNumber, declaredFieldsNumber);
Expand Down Expand Up @@ -133,6 +133,7 @@ public void testDeepCopyTask() {
task.setIsolationGroupId("groupId");
task.setStartTime(12L);
task.setEndTime(20L);
task.setFirstStartTime(12L);
task.setScheduledTime(7L);
task.setRetried(false);
task.setReasonForIncompletion("");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ void checkTaskTimeout(TaskDef taskDef, TaskModel task) {
return;
}

if(elapsedTimeFromFirstTaskExecution < totalTaskTimeout) {
if (elapsedTimeFromFirstTaskExecution < totalTaskTimeout) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ private void createKitchenSink() throws Exception {
List<TaskDef> taskDefs = new LinkedList<>();
TaskDef taskDef;
for (int i = 0; i < 40; i++) {
taskDef = new TaskDef("task_" + i, "task_" + i, 1, 0);
taskDef = new TaskDef("task_" + i, "task_" + i, 1, 0, 10);
taskDef.setOwnerEmail("[email protected]");
taskDefs.add(taskDef);
}

taskDef = new TaskDef("search_elasticsearch", "search_elasticsearch", 1, 0);
taskDef = new TaskDef("search_elasticsearch", "search_elasticsearch", 1, 0, 10);
taskDef.setOwnerEmail("[email protected]");
taskDefs.add(taskDef);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ protected List<TaskDef> createAndRegisterTaskDefinitions(
DEFAULT_EMAIL_ADDRESS,
3,
60,
60);
60,
300);
def.setTimeoutPolicy(TaskDef.TimeoutPolicy.RETRY);
definitions.add(def);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void testAll() throws Exception {
assertNotNull(taskClient);
List<TaskDef> defs = new LinkedList<>();
for (int i = 0; i < 5; i++) {
TaskDef def = new TaskDef("t" + i, "task " + i, DEFAULT_EMAIL_ADDRESS, 3, 60, 60);
TaskDef def = new TaskDef("t" + i, "task " + i, DEFAULT_EMAIL_ADDRESS, 3, 60, 60, 300);
def.setTimeoutPolicy(TimeoutPolicy.RETRY);
defs.add(def);
}
Expand Down

0 comments on commit 039e8af

Please sign in to comment.