-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KOGITO-9659: Workflow timeout not working using external Job Service …
…(management-addon) (#1822)
- Loading branch information
Showing
8 changed files
with
256 additions
and
7 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
...ration-tests-jobs-service-common/src/main/resources/org/acme/sw/workflow-timeouts.sw.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"id": "workflow_timeouts", | ||
"version": "1.0", | ||
"name": "Workflow Timeouts", | ||
"description": "Workflow Timeouts Test", | ||
"start": "printWaitMessage", | ||
"timeouts": { | ||
"workflowExecTimeout": "PT5S" | ||
}, | ||
"events": [ | ||
{ | ||
"name": "wakeUpEvent", | ||
"source": "", | ||
"type": "workflow_timeouts_wake_up_event_in" | ||
} | ||
], | ||
"functions": [ | ||
{ | ||
"name": "printMessage", | ||
"type": "custom", | ||
"operation": "sysout" | ||
} | ||
], | ||
"states": [ | ||
{ | ||
"name": "printWaitMessage", | ||
"type": "operation", | ||
"actions": [ | ||
{ | ||
"name": "printBeforeEvent", | ||
"functionRef": { | ||
"refName": "printMessage", | ||
"arguments": { | ||
"message": "Waiting for event" | ||
} | ||
} | ||
} | ||
], | ||
"transition": "waitForEvent" | ||
}, | ||
{ | ||
"name": "waitForEvent", | ||
"type": "event", | ||
"onEvents": [ | ||
{ | ||
"eventRefs": [ | ||
"wakeUpEvent" | ||
], | ||
"actions": [] | ||
} | ||
], | ||
"end": true | ||
} | ||
] | ||
} |
39 changes: 39 additions & 0 deletions
39
...s-service-common-quarkus/src/test/java/org/kie/kogito/it/jobs/BaseWorkflowTimeoutsIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright 2023 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.kie.kogito.it.jobs; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.kie.kogito.test.utils.ProcessInstancesRESTTestUtils.assertProcessInstanceHasFinished; | ||
import static org.kie.kogito.test.utils.ProcessInstancesRESTTestUtils.newProcessInstanceAndGetId; | ||
|
||
public abstract class BaseWorkflowTimeoutsIT { | ||
|
||
private static final String EMPTY_WORKFLOW_DATA = "{\"workflowdata\" : \"\"}"; | ||
|
||
protected static final String WORKFLOW_TIMEOUTS_URL = "/workflow_timeouts"; | ||
private static final String WORKFLOW_TIMEOUTS_GET_BY_ID_URL = WORKFLOW_TIMEOUTS_URL + "/{id}"; | ||
|
||
@Test | ||
void workflowTimeoutExceeded() { | ||
// Start a new process instance. | ||
String processInstanceId = newProcessInstanceAndGetId(WORKFLOW_TIMEOUTS_URL, EMPTY_WORKFLOW_DATA); | ||
// Give enough time for the timeout to exceed. | ||
assertProcessInstanceHasFinished(WORKFLOW_TIMEOUTS_GET_BY_ID_URL, processInstanceId, 1, 180); | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
...obs-service-quarkus-embedded/src/test/java/org/kie/kogito/it/jobs/WorkflowTimeoutsIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2023 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.kie.kogito.it.jobs; | ||
|
||
import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
||
@QuarkusIntegrationTest | ||
class WorkflowTimeoutsIT extends BaseWorkflowTimeoutsIT { | ||
} |
29 changes: 29 additions & 0 deletions
29
...ice-quarkus-knative-eventing/src/test/java/org/kie/kogito/it/jobs/WorkflowTimeoutsIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright 2023 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.kie.kogito.it.jobs; | ||
|
||
import org.kie.kogito.test.resources.JobServiceTestResource; | ||
import org.kie.kogito.testcontainers.quarkus.KafkaQuarkusTestResource; | ||
|
||
import io.quarkus.test.common.QuarkusTestResource; | ||
import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
||
@QuarkusIntegrationTest | ||
@QuarkusTestResource(KafkaQuarkusTestResource.class) | ||
@JobServiceTestResource(knativeEventingEnabled = true) | ||
class WorkflowTimeoutsIT extends BaseWorkflowTimeoutsIT { | ||
} |
29 changes: 29 additions & 0 deletions
29
...s-service-quarkus-management/src/test/java/org/kie/kogito/it/jobs/WorkflowTimeoutsIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright 2023 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.kie.kogito.it.jobs; | ||
|
||
import org.kie.kogito.test.resources.JobServiceTestResource; | ||
import org.kie.kogito.testcontainers.quarkus.KafkaQuarkusTestResource; | ||
|
||
import io.quarkus.test.common.QuarkusTestResource; | ||
import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
||
@QuarkusIntegrationTest | ||
@QuarkusTestResource(KafkaQuarkusTestResource.class) | ||
@JobServiceTestResource | ||
class WorkflowTimeoutsIT extends BaseWorkflowTimeoutsIT { | ||
} |
26 changes: 26 additions & 0 deletions
26
...bs-service-quarkus-messaging/src/test/java/org/kie/kogito/it/jobs/WorkflowTimeoutsIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2023 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.kie.kogito.it.jobs; | ||
|
||
import org.kie.kogito.test.resources.JobServiceTestResource; | ||
|
||
import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
||
@QuarkusIntegrationTest | ||
@JobServiceTestResource(kafkaEnabled = true) | ||
class WorkflowTimeoutsIT extends BaseWorkflowTimeoutsIT { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters