This is an automated email from the ASF dual-hosted git repository.
djoseph pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-apps.git
The following commit(s) were added to refs/heads/main by this push:
new 6be874df5 [incubator-kie-issues#2271] Missing indexes on foreign keys
(#2309)
6be874df5 is described below
commit 6be874df5e33dae20cfdb7ff5ac8eedafc6ba69d
Author: Deepak Joseph <[email protected]>
AuthorDate: Mon Mar 23 16:25:07 2026 +0530
[incubator-kie-issues#2271] Missing indexes on foreign keys (#2309)
* Missing indexes for foreign keys
* Failing test fix
* test fixes
---
.../main/resources/FailingAsyncServiceTask.bpmn2 | 2 +-
.../src/main/resources/FailingSyncServiceTask.bpmn2 | 2 +-
.../org/kie/kogito/FailingAsyncServiceTaskIT.java | 4 ++--
.../java/org/kie/kogito/FailingServiceTestUtil.java | 2 +-
.../org/kie/kogito/FailingSyncServiceTaskIT.java | 13 ++++---------
.../db/data-audit/h2/V1.5.1__Create_indexes.sql | 21 +++++++++++++++++++++
.../postgresql/V1.5.1__Create_indexes.sql | 21 +++++++++++++++++++++
7 files changed, 51 insertions(+), 14 deletions(-)
diff --git
a/apps-integration-tests/integration-tests-jobs/src/main/resources/FailingAsyncServiceTask.bpmn2
b/apps-integration-tests/integration-tests-jobs/src/main/resources/FailingAsyncServiceTask.bpmn2
index 95f632771..a3eee3c97 100644
---
a/apps-integration-tests/integration-tests-jobs/src/main/resources/FailingAsyncServiceTask.bpmn2
+++
b/apps-integration-tests/integration-tests-jobs/src/main/resources/FailingAsyncServiceTask.bpmn2
@@ -125,7 +125,7 @@
<bpmn2:boundaryEvent id="_12026FED-3D13-4409-9397-6F84D9323F3D"
drools:dockerinfo="48.0377358490566^74|" drools:boundaryca="true"
attachedToRef="_E2424AB3-6F2A-4624-B451-C126EE9EABA1">
<bpmn2:outgoing>_7F20517C-28E8-46CE-9B44-E8A92AE86F46</bpmn2:outgoing>
<bpmn2:timerEventDefinition>
- <bpmn2:timeDuration
xsi:type="bpmn2:tFormalExpression">PT2S</bpmn2:timeDuration>
+ <bpmn2:timeDuration
xsi:type="bpmn2:tFormalExpression">PT4S</bpmn2:timeDuration>
</bpmn2:timerEventDefinition>
</bpmn2:boundaryEvent>
</bpmn2:process>
diff --git
a/apps-integration-tests/integration-tests-jobs/src/main/resources/FailingSyncServiceTask.bpmn2
b/apps-integration-tests/integration-tests-jobs/src/main/resources/FailingSyncServiceTask.bpmn2
index 28953f755..a7b34f2d1 100644
---
a/apps-integration-tests/integration-tests-jobs/src/main/resources/FailingSyncServiceTask.bpmn2
+++
b/apps-integration-tests/integration-tests-jobs/src/main/resources/FailingSyncServiceTask.bpmn2
@@ -122,7 +122,7 @@
<bpmn2:boundaryEvent id="_12026FED-3D13-4409-9397-6F84D9323F3D"
drools:dockerinfo="48.0377358490566^74|" drools:boundaryca="true"
attachedToRef="_E2424AB3-6F2A-4624-B451-C126EE9EABA1">
<bpmn2:outgoing>_7F20517C-28E8-46CE-9B44-E8A92AE86F46</bpmn2:outgoing>
<bpmn2:timerEventDefinition>
- <bpmn2:timeDuration
xsi:type="bpmn2:tFormalExpression">PT2S</bpmn2:timeDuration>
+ <bpmn2:timeDuration
xsi:type="bpmn2:tFormalExpression">PT4S</bpmn2:timeDuration>
</bpmn2:timerEventDefinition>
</bpmn2:boundaryEvent>
</bpmn2:process>
diff --git
a/apps-integration-tests/integration-tests-jobs/src/test/java/org/kie/kogito/FailingAsyncServiceTaskIT.java
b/apps-integration-tests/integration-tests-jobs/src/test/java/org/kie/kogito/FailingAsyncServiceTaskIT.java
index f79c77a06..a7792470d 100644
---
a/apps-integration-tests/integration-tests-jobs/src/test/java/org/kie/kogito/FailingAsyncServiceTaskIT.java
+++
b/apps-integration-tests/integration-tests-jobs/src/test/java/org/kie/kogito/FailingAsyncServiceTaskIT.java
@@ -76,7 +76,7 @@ class FailingAsyncServiceTaskIT {
assertThat(processBefore.get("error")).isNull();
List<Map<String, Object>> nodesBefore =
resultBefore.get("data.ProcessInstances[0].nodes");
- assertThat(nodesBefore).hasSize(3);
+ assertThat(nodesBefore).isNotEmpty();
Map<String, Object> userTaskNodeBefore = nodesBefore.stream()
.filter(node ->
USER_TASK_NODE_DEFINTION_ID.equals(node.get("definitionId")))
@@ -92,7 +92,7 @@ class FailingAsyncServiceTaskIT {
assertThat(jobBefore.get("nodeInstanceId")).isEqualTo(userTaskNodeInstanceId);
assertThat(jobBefore.get("status")).isIn("SCHEDULED", "RETRY");
- // After 2s Boundary Timer triggers
+ // After 4s Boundary Timer triggers
JsonPath resultAfter = await()
.pollDelay(POLL_DELAY)
.atMost(TIMEOUT)
diff --git
a/apps-integration-tests/integration-tests-jobs/src/test/java/org/kie/kogito/FailingServiceTestUtil.java
b/apps-integration-tests/integration-tests-jobs/src/test/java/org/kie/kogito/FailingServiceTestUtil.java
index f57382aea..c67f868be 100644
---
a/apps-integration-tests/integration-tests-jobs/src/test/java/org/kie/kogito/FailingServiceTestUtil.java
+++
b/apps-integration-tests/integration-tests-jobs/src/test/java/org/kie/kogito/FailingServiceTestUtil.java
@@ -34,7 +34,7 @@ public final class FailingServiceTestUtil {
public static final String USER_TASK_NODE_DEFINTION_ID =
"_E2424AB3-6F2A-4624-B451-C126EE9EABA1";
public static final Duration TIMEOUT = Duration.ofSeconds(10);
- public static final Duration POLL_DELAY = Duration.ofSeconds(3);
+ public static final Duration POLL_DELAY = Duration.ofSeconds(5);
public static final Duration POLL_INTERVAL = Duration.ofMillis(500);
private FailingServiceTestUtil() {
diff --git
a/apps-integration-tests/integration-tests-jobs/src/test/java/org/kie/kogito/FailingSyncServiceTaskIT.java
b/apps-integration-tests/integration-tests-jobs/src/test/java/org/kie/kogito/FailingSyncServiceTaskIT.java
index 2033ba9f6..7151d1b53 100644
---
a/apps-integration-tests/integration-tests-jobs/src/test/java/org/kie/kogito/FailingSyncServiceTaskIT.java
+++
b/apps-integration-tests/integration-tests-jobs/src/test/java/org/kie/kogito/FailingSyncServiceTaskIT.java
@@ -18,7 +18,6 @@
*/
package org.kie.kogito;
-import java.time.Duration;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -34,11 +33,7 @@ import static io.restassured.RestAssured.given;
import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import static org.hamcrest.CoreMatchers.notNullValue;
-import static
org.kie.kogito.FailingServiceTestUtil.FAILING_SYNC_SERVICE_TASK_PROCESS_ID;
-import static org.kie.kogito.FailingServiceTestUtil.TIMEOUT;
-import static
org.kie.kogito.FailingServiceTestUtil.USER_TASK_NODE_DEFINTION_ID;
-import static org.kie.kogito.FailingServiceTestUtil.executeGraphQLQuery;
-import static org.kie.kogito.FailingServiceTestUtil.getQuery;
+import static org.kie.kogito.FailingServiceTestUtil.*;
@QuarkusIntegrationTest
class FailingSyncServiceTaskIT {
@@ -96,11 +91,11 @@ class FailingSyncServiceTaskIT {
assertThat(jobBefore.get("nodeInstanceId")).isEqualTo(userTaskNodeInstanceId);
assertThat(jobBefore.get("status")).isIn("SCHEDULED", "RETRY");
- // After 2s Boundary Timer triggers
+ // After 4s Boundary Timer triggers
JsonPath resultAfter = await()
- .pollDelay(Duration.ofSeconds(3))
+ .pollDelay(POLL_DELAY)
.atMost(TIMEOUT)
- .pollInterval(Duration.ofMillis(500))
+ .pollInterval(POLL_INTERVAL)
.until(() -> {
JsonPath result = executeGraphQLQuery(query);
diff --git
a/data-audit/kogito-addons-data-audit-jpa/kogito-addons-data-audit-jpa-common/src/main/resources/kie-flyway/db/data-audit/h2/V1.5.1__Create_indexes.sql
b/data-audit/kogito-addons-data-audit-jpa/kogito-addons-data-audit-jpa-common/src/main/resources/kie-flyway/db/data-audit/h2/V1.5.1__Create_indexes.sql
new file mode 100644
index 000000000..708702449
--- /dev/null
+++
b/data-audit/kogito-addons-data-audit-jpa/kogito-addons-data-audit-jpa-common/src/main/resources/kie-flyway/db/data-audit/h2/V1.5.1__Create_indexes.sql
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+CREATE INDEX idx_tiaul_tialid ON
task_instance_assignment_users_log(task_instance_assignment_log_id);
+CREATE INDEX idx_pisrl_pislid ON
process_instance_state_roles_log(process_instance_state_log_id);
diff --git
a/data-audit/kogito-addons-data-audit-jpa/kogito-addons-data-audit-jpa-common/src/main/resources/kie-flyway/db/data-audit/postgresql/V1.5.1__Create_indexes.sql
b/data-audit/kogito-addons-data-audit-jpa/kogito-addons-data-audit-jpa-common/src/main/resources/kie-flyway/db/data-audit/postgresql/V1.5.1__Create_indexes.sql
new file mode 100644
index 000000000..708702449
--- /dev/null
+++
b/data-audit/kogito-addons-data-audit-jpa/kogito-addons-data-audit-jpa-common/src/main/resources/kie-flyway/db/data-audit/postgresql/V1.5.1__Create_indexes.sql
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+CREATE INDEX idx_tiaul_tialid ON
task_instance_assignment_users_log(task_instance_assignment_log_id);
+CREATE INDEX idx_pisrl_pislid ON
process_instance_state_roles_log(process_instance_state_log_id);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]