Skip to content

Commit

Permalink
Fixed test harness
Browse files Browse the repository at this point in the history
  • Loading branch information
Shailesh Jagannath Padave committed Nov 19, 2024
1 parent f302540 commit f8923c7
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ class DoWhileSpec extends AbstractSpecification {
def persistedTaskDefinition = workflowTestUtil.getPersistedTaskDefinition(taskName).get()
def modifiedTaskDefinition = new TaskDef(persistedTaskDefinition.name, persistedTaskDefinition.description,
persistedTaskDefinition.ownerEmail, 0, persistedTaskDefinition.timeoutSeconds,
persistedTaskDefinition.responseTimeoutSeconds)
persistedTaskDefinition.responseTimeoutSeconds,persistedTaskDefinition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedTaskDefinition)

when: "A do while workflow is started"
Expand Down Expand Up @@ -876,7 +876,7 @@ class DoWhileSpec extends AbstractSpecification {
def persistedTaskDefinition = workflowTestUtil.getPersistedTaskDefinition(taskName).get()
def modifiedTaskDefinition = new TaskDef(persistedTaskDefinition.name, persistedTaskDefinition.description,
persistedTaskDefinition.ownerEmail, 1, persistedTaskDefinition.timeoutSeconds,
persistedTaskDefinition.responseTimeoutSeconds)
persistedTaskDefinition.responseTimeoutSeconds,persistedTaskDefinition.totalTimeoutSeconds)
modifiedTaskDefinition.setRetryDelaySeconds(0)
metadataService.updateTaskDef(modifiedTaskDefinition)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ class DynamicForkJoinSpec extends AbstractSpecification {
def persistedTask2Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_2').get()
def modifiedTask2Definition = new TaskDef(persistedTask2Definition.name,
persistedTask2Definition.description, persistedTask2Definition.ownerEmail, 0,
persistedTask2Definition.timeoutSeconds, persistedTask2Definition.responseTimeoutSeconds)
persistedTask2Definition.timeoutSeconds, persistedTask2Definition.responseTimeoutSeconds,
persistedTask2Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedTask2Definition)

when: " a dynamic fork join workflow is started"
Expand Down Expand Up @@ -237,7 +238,8 @@ class DynamicForkJoinSpec extends AbstractSpecification {
def persistedTask2Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_2').get()
def modifiedTask2Definition = new TaskDef(persistedTask2Definition.name,
persistedTask2Definition.description, persistedTask2Definition.ownerEmail, 0,
persistedTask2Definition.timeoutSeconds, persistedTask2Definition.responseTimeoutSeconds)
persistedTask2Definition.timeoutSeconds, persistedTask2Definition.responseTimeoutSeconds,
persistedTask2Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedTask2Definition)

when: " a dynamic fork join workflow is started"
Expand Down Expand Up @@ -390,7 +392,8 @@ class DynamicForkJoinSpec extends AbstractSpecification {
def persistedTask2Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_2').get()
def modifiedTask2Definition = new TaskDef(persistedTask2Definition.name,
persistedTask2Definition.description, persistedTask2Definition.ownerEmail, 0,
persistedTask2Definition.timeoutSeconds, persistedTask2Definition.responseTimeoutSeconds)
persistedTask2Definition.timeoutSeconds, persistedTask2Definition.responseTimeoutSeconds,
persistedTask2Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedTask2Definition)

when: "the dynamic fork join workflow is started"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ class ExternalPayloadStorageSpec extends AbstractSpecification {
def persistedTask2Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_2').get()
def modifiedTask2Definition = new TaskDef(persistedTask2Definition.name, persistedTask2Definition.description,
persistedTask2Definition.ownerEmail, 2, persistedTask2Definition.timeoutSeconds,
persistedTask2Definition.responseTimeoutSeconds)
persistedTask2Definition.responseTimeoutSeconds,persistedTask2Definition.totalTimeoutSeconds)
modifiedTask2Definition.setRetryDelaySeconds(0)
metadataService.updateTaskDef(modifiedTask2Definition)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ class ForkJoinSpec extends AbstractSpecification {
def persistedIntegrationTask2Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_2').get()
def modifiedIntegrationTask2Definition = new TaskDef(persistedIntegrationTask2Definition.name,
persistedIntegrationTask2Definition.description, persistedIntegrationTask2Definition.ownerEmail, 0,
0, persistedIntegrationTask2Definition.responseTimeoutSeconds)
0, persistedIntegrationTask2Definition.responseTimeoutSeconds,
persistedIntegrationTask2Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedIntegrationTask2Definition)

when: "A fork join workflow is started"
Expand Down Expand Up @@ -276,7 +277,8 @@ class ForkJoinSpec extends AbstractSpecification {
def persistedIntegrationTask1Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_1').get()
def modifiedIntegrationTask1Definition = new TaskDef(persistedIntegrationTask1Definition.name,
persistedIntegrationTask1Definition.description, persistedIntegrationTask1Definition.ownerEmail, 0,
0, persistedIntegrationTask1Definition.responseTimeoutSeconds)
0, persistedIntegrationTask1Definition.responseTimeoutSeconds,
persistedIntegrationTask1Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedIntegrationTask1Definition)

when: "A fork join workflow is started"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class HierarchicalForkJoinSubworkflowRerunSpec extends AbstractSpecification {
persistedTask2Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_2').get()
def modifiedTask2Definition = new TaskDef(persistedTask2Definition.name, persistedTask2Definition.description,
persistedTask2Definition.ownerEmail, 0, persistedTask2Definition.timeoutSeconds,
persistedTask2Definition.responseTimeoutSeconds)
persistedTask2Definition.responseTimeoutSeconds, persistedTask2Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedTask2Definition)

and: "an existing workflow with subworkflow and registered definitions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class HierarchicalForkJoinSubworkflowRestartSpec extends AbstractSpecification {
persistedTask2Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_2').get()
def modifiedTask2Definition = new TaskDef(persistedTask2Definition.name, persistedTask2Definition.description,
persistedTask2Definition.ownerEmail, 0, persistedTask2Definition.timeoutSeconds,
persistedTask2Definition.responseTimeoutSeconds)
persistedTask2Definition.responseTimeoutSeconds, persistedTask2Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedTask2Definition)

and: "an existing workflow with subworkflow and registered definitions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class HierarchicalForkJoinSubworkflowRetrySpec extends AbstractSpecification {
persistedTask2Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_2').get()
def modifiedTask2Definition = new TaskDef(persistedTask2Definition.name, persistedTask2Definition.description,
persistedTask2Definition.ownerEmail, 0, persistedTask2Definition.timeoutSeconds,
persistedTask2Definition.responseTimeoutSeconds)
persistedTask2Definition.responseTimeoutSeconds, persistedTask2Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedTask2Definition)

and: "an existing workflow with subworkflow and registered definitions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class NestedForkJoinSubWorkflowSpec extends AbstractSpecification {
persistedTask2Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_2').get()
def modifiedTask2Definition = new TaskDef(persistedTask2Definition.name, persistedTask2Definition.description,
persistedTask2Definition.ownerEmail, 0, persistedTask2Definition.timeoutSeconds,
persistedTask2Definition.responseTimeoutSeconds)
persistedTask2Definition.responseTimeoutSeconds, persistedTask2Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedTask2Definition)

and: "an existing workflow with subworkflow and registered definitions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class SimpleWorkflowSpec extends AbstractSpecification {
def persistedTask1Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_1').get()
def modifiedTask1Definition = new TaskDef(persistedTask1Definition.name, persistedTask1Definition.description,
persistedTask1Definition.ownerEmail, 1, persistedTask1Definition.timeoutSeconds,
persistedTask1Definition.responseTimeoutSeconds)
persistedTask1Definition.responseTimeoutSeconds, persistedTask1Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedTask1Definition)
def workflowDef = metadataService.getWorkflowDef(LINEAR_WORKFLOW_T1_T2, 1)

Expand Down Expand Up @@ -360,7 +360,7 @@ class SimpleWorkflowSpec extends AbstractSpecification {
def persistedTask1Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_1').get()
def modifiedTaskDefinition = new TaskDef(persistedTask1Definition.name, persistedTask1Definition.description,
persistedTask1Definition.ownerEmail, 0, persistedTask1Definition.timeoutSeconds,
persistedTask1Definition.responseTimeoutSeconds)
persistedTask1Definition.responseTimeoutSeconds, persistedTask1Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedTaskDefinition)

when: "Get the workflow definition associated with the simple workflow"
Expand Down Expand Up @@ -438,7 +438,7 @@ class SimpleWorkflowSpec extends AbstractSpecification {
def persistedTask1Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_1').get()
def modifiedTaskDefinition = new TaskDef(persistedTask1Definition.name, persistedTask1Definition.description,
persistedTask1Definition.ownerEmail, 0, persistedTask1Definition.timeoutSeconds,
persistedTask1Definition.responseTimeoutSeconds)
persistedTask1Definition.responseTimeoutSeconds, persistedTask1Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedTaskDefinition)

when: "Get the workflow definition associated with the simple workflow"
Expand Down Expand Up @@ -537,7 +537,7 @@ class SimpleWorkflowSpec extends AbstractSpecification {
def integrationTask2Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_2').get()
def modifiedTaskDefinition = new TaskDef(integrationTask2Definition.name, integrationTask2Definition.description,
integrationTask2Definition.ownerEmail, 3, integrationTask2Definition.timeoutSeconds,
integrationTask2Definition.responseTimeoutSeconds)
integrationTask2Definition.responseTimeoutSeconds, integrationTask2Definition.totalTimeoutSeconds)
modifiedTaskDefinition.retryDelaySeconds = 2
metadataService.updateTaskDef(modifiedTaskDefinition)

Expand Down Expand Up @@ -614,7 +614,7 @@ class SimpleWorkflowSpec extends AbstractSpecification {
def integrationTask1Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_1').get()
def modifiedTaskDefinition = new TaskDef(integrationTask1Definition.name, integrationTask1Definition.description,
integrationTask1Definition.ownerEmail, 1, integrationTask1Definition.timeoutSeconds,
integrationTask1Definition.responseTimeoutSeconds)
integrationTask1Definition.responseTimeoutSeconds, integrationTask1Definition.totalTimeoutSeconds)
modifiedTaskDefinition.retryDelaySeconds = 0
metadataService.updateTaskDef(modifiedTaskDefinition)

Expand Down Expand Up @@ -881,7 +881,7 @@ class SimpleWorkflowSpec extends AbstractSpecification {
def integrationTask1Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_1').get()
def modifiedTaskDefinition = new TaskDef(integrationTask1Definition.name, integrationTask1Definition.description,
integrationTask1Definition.ownerEmail, 0, integrationTask1Definition.timeoutSeconds,
integrationTask1Definition.responseTimeoutSeconds)
integrationTask1Definition.responseTimeoutSeconds, integrationTask1Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedTaskDefinition)

def simpleWorkflowDefinition = metadataService.getWorkflowDef(LINEAR_WORKFLOW_T1_T2, 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class SubWorkflowRerunSpec extends AbstractSpecification {
persistedTask2Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_2').get()
def modifiedTask2Definition = new TaskDef(persistedTask2Definition.name, persistedTask2Definition.description,
persistedTask2Definition.ownerEmail, 0, persistedTask2Definition.timeoutSeconds,
persistedTask2Definition.responseTimeoutSeconds)
persistedTask2Definition.responseTimeoutSeconds, persistedTask2Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedTask2Definition)

and: "an existing workflow with subworkflow and registered definitions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class SubWorkflowRestartSpec extends AbstractSpecification {
persistedTask2Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_2').get()
def modifiedTask2Definition = new TaskDef(persistedTask2Definition.name, persistedTask2Definition.description,
persistedTask2Definition.ownerEmail, 0, persistedTask2Definition.timeoutSeconds,
persistedTask2Definition.responseTimeoutSeconds)
persistedTask2Definition.responseTimeoutSeconds,persistedTask2Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedTask2Definition)

and: "an existing workflow with subworkflow and registered definitions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SubWorkflowRetrySpec extends AbstractSpecification {
persistedTask2Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_2').get()
def modifiedTask2Definition = new TaskDef(persistedTask2Definition.name, persistedTask2Definition.description,
persistedTask2Definition.ownerEmail, 0, persistedTask2Definition.timeoutSeconds,
persistedTask2Definition.responseTimeoutSeconds)
persistedTask2Definition.responseTimeoutSeconds, persistedTask2Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedTask2Definition)

and: "an existing workflow with subworkflow and registered definitions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class SubWorkflowSpec extends AbstractSpecification {
def persistedTask2Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_2').get()
def modifiedTask2Definition = new TaskDef(persistedTask2Definition.name, persistedTask2Definition.description,
persistedTask2Definition.ownerEmail, 0, persistedTask2Definition.timeoutSeconds,
persistedTask2Definition.responseTimeoutSeconds)
persistedTask2Definition.responseTimeoutSeconds, persistedTask2Definition.totalTimeoutSeconds)
metadataService.updateTaskDef(modifiedTask2Definition)

and: "an existing workflow with subworkflow and registered definitions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class WorkflowAndTaskConfigurationSpec extends AbstractSpecification {
setup: "Register a task definition with retry policy on time out"
def persistedTask1Definition = workflowTestUtil.getPersistedTaskDefinition('integration_task_1').get()
def modifiedTaskDefinition = new TaskDef(persistedTask1Definition.name, persistedTask1Definition.description,
persistedTask1Definition.ownerEmail, 1, 1, 1)
persistedTask1Definition.ownerEmail, 1, 1, 1, 30)
modifiedTaskDefinition.retryDelaySeconds = 0
modifiedTaskDefinition.timeoutPolicy = TaskDef.TimeoutPolicy.RETRY
metadataService.updateTaskDef(modifiedTaskDefinition)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ class WorkflowTestUtil {

(0..20).collect { "integration_task_$it" }
.findAll { !getPersistedTaskDefinition(it).isPresent() }
.collect { new TaskDef(it, it, DEFAULT_EMAIL_ADDRESS, 1, 120, 120) }
.collect { new TaskDef(it, it, DEFAULT_EMAIL_ADDRESS, 1, 120, 120, 500) }
.forEach { metadataService.registerTaskDef([it]) }

(0..4).collect { "integration_task_0_RT_$it" }
.findAll { !getPersistedTaskDefinition(it).isPresent() }
.collect { new TaskDef(it, it, DEFAULT_EMAIL_ADDRESS, 0, 120, 120) }
.collect { new TaskDef(it, it, DEFAULT_EMAIL_ADDRESS, 0, 120, 120, 500) }
.forEach { metadataService.registerTaskDef([it]) }

metadataService.registerTaskDef([new TaskDef('short_time_out', 'short_time_out', DEFAULT_EMAIL_ADDRESS, 1, 5, 5)])
metadataService.registerTaskDef([new TaskDef('short_time_out', 'short_time_out', DEFAULT_EMAIL_ADDRESS, 1, 5, 5, 50)])

//This taskWithResponseTimeOut is required by the integration test which exercises the response time out scenarios
TaskDef taskWithResponseTimeOut = new TaskDef()
Expand All @@ -97,6 +97,7 @@ class WorkflowTestUtil {
taskWithResponseTimeOut.retryCount = RETRY_COUNT
taskWithResponseTimeOut.retryDelaySeconds = 0
taskWithResponseTimeOut.responseTimeoutSeconds = 10
taskWithResponseTimeOut.totalTimeoutSeconds = 500
taskWithResponseTimeOut.ownerEmail = DEFAULT_EMAIL_ADDRESS

TaskDef optionalTask = new TaskDef()
Expand Down Expand Up @@ -163,6 +164,7 @@ class WorkflowTestUtil {
eventTaskX.name = 'eventX'
eventTaskX.timeoutSeconds = 10
eventTaskX.responseTimeoutSeconds = 10
eventTaskX.totalTimeoutSeconds = 100
eventTaskX.ownerEmail = DEFAULT_EMAIL_ADDRESS

metadataService.registerTaskDef(
Expand Down

0 comments on commit f8923c7

Please sign in to comment.