apache / incubator-kie-kogito-runtimes

Kogito Runtimes - Kogito is a cloud-native business automation technology for building cloud-ready business applications.
http://kogito.kie.org
Apache License 2.0
543 stars 210 forks source link

Fixing status flaky test #3777

Closed fjtirado closed 1 week ago

fjtirado commented 1 week ago

AbstracPRocessInstance.getStatus does not inmediately match WorfklowProcessIntance.getState after KogitoProcessEventListener.afterProcessCompleted is invoked (eventually they are sync). There is a chance that tests that relies on afterProcessCompleted to handle CountdownLatch receive a wrong status is they check the status just after the countdownlatch reach zero (thats why those test are flaky)

kie-ci3 commented 1 week ago

PR job #3 was: UNSTABLE Possible explanation: This should be test failures

Reproducer build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-runtimes -u https://github.com/apache/incubator-kie-kogito-runtimes/pull/3777 --skipParallelCheckout NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-3777/3/display/redirect

Test results:

Those are the test failures:

org.kie.persistence.filesystem.FileSystemProcessInstancesTest.testBasicFlow
Expecting value to be true but was false
org.kie.persistence.filesystem.FileSystemProcessInstancesTest.testBasicFlowWithStartFrom Cannot invoke "org.jbpm.workflow.instance.WorkflowProcessInstance.getVariables()" because "this.processInstance" is null
org.kie.persistence.filesystem.FileSystemProcessInstancesTest.testValuesReadMode No value present
org.kie.persistence.filesystem.FileSystemProcessInstancesTest.testFindByIdReadMode No value present
org.kie.persistence.jdbc.PostgreSqlProcessInstancesIT.testBasicFlow No value present
org.kie.persistence.jdbc.PostgreSqlProcessInstancesIT.testMultipleProcesses
Expected size: 1 but was: 0 in:
[]
org.kie.persistence.jdbc.PostgreSqlProcessInstancesIT.testProcessWithDifferentVersion
Expected size: 1 but was: 0 in:
[]
org.kie.persistence.jdbc.PostgreSqlProcessInstancesIT.testBasicTaskFlow
Expecting value to be true but was false
org.kie.persistence.jdbc.PostgreSqlProcessInstancesIT.testRemove
Expected size: 1 but was: 0 in:
[]
org.kie.persistence.jdbc.PostgreSqlProcessInstancesIT.testUpdate No value present
org.kie.persistence.jdbc.PostgreSqlProcessInstancesLockIT.testMigrateSingle Process instance with id '93678156-9b87-4d63-9840-78bd53cf3c56' updated or deleted by other request
org.kie.persistence.jdbc.PostgreSqlProcessInstancesLockIT.testMigrateAll Process instance with id '471ba762-b82c-4748-9d6c-2912f3155ace' updated or deleted by other request
org.kie.persistence.jdbc.PostgreSqlProcessInstancesLockIT.testBasicFlow Process instance with id '4ae463b8-1971-4492-89e0-46a7b698cb46' updated or deleted by other request
org.kie.persistence.jdbc.PostgreSqlProcessInstancesLockIT.testMultipleProcesses Process instance with id '648b8a1d-76ac-4222-a6cb-0013ca5c4436' updated or deleted by other request
org.kie.persistence.jdbc.PostgreSqlProcessInstancesLockIT.testProcessWithDifferentVersion Process instance with id '0e4d0dc1-6414-4ee3-ae2d-0daa69c283f1' updated or deleted by other request
org.kie.persistence.jdbc.PostgreSqlProcessInstancesLockIT.testBasicTaskFlow Process instance with id 'ca019b0b-7bb2-4dc4-b969-4ba52fc5a316' updated or deleted by other request
org.kie.persistence.jdbc.PostgreSqlProcessInstancesLockIT.testRemove Process instance with id 'a835b0c3-d594-4452-aee5-50a55738f6d0' updated or deleted by other request
org.kie.persistence.jdbc.PostgreSqlProcessInstancesLockIT.testUpdate Process instance with id '05beb70d-669c-4275-a42a-e928d8adf2f0' updated or deleted by other request
org.kie.persistence.postgresql.PostgresqlProcessInstancesIT.testMigrateSingle Cannot invoke "org.jbpm.process.instance.ProcessInstance.configureTimers()" because "jbpmProcessInstance" is null
org.kie.persistence.postgresql.PostgresqlProcessInstancesIT.testMigrateAll Cannot invoke "org.jbpm.process.instance.ProcessInstance.configureTimers()" because "jbpmProcessInstance" is null
org.kie.persistence.postgresql.PostgresqlProcessInstancesIT.testBasicFlow Cannot invoke "org.jbpm.process.instance.ProcessInstance.configureTimers()" because "jbpmProcessInstance" is null
org.kie.persistence.postgresql.PostgresqlProcessInstancesIT.testMultipleProcesses Cannot invoke "org.jbpm.process.instance.ProcessInstance.configureTimers()" because "jbpmProcessInstance" is null
org.kie.persistence.postgresql.PostgresqlProcessInstancesIT.testProcessWithDifferentVersion Cannot invoke "org.jbpm.process.instance.ProcessInstance.configureTimers()" because "jbpmProcessInstance" is null
org.kie.persistence.postgresql.PostgresqlProcessInstancesIT.testRemove Cannot invoke "org.jbpm.process.instance.ProcessInstance.configureTimers()" because "jbpmProcessInstance" is null
org.kie.persistence.postgresql.PostgresqlProcessInstancesIT.testUpdate Cannot invoke "org.jbpm.process.instance.ProcessInstance.configureTimers()" because "jbpmProcessInstance" is null
org.kie.persistence.postgresql.PostgresqlProcessInstancesWithLockIT.testMigrateSingle Cannot invoke "org.jbpm.process.instance.ProcessInstance.configureTimers()" because "jbpmProcessInstance" is null
org.kie.persistence.postgresql.PostgresqlProcessInstancesWithLockIT.testMigrateAll Cannot invoke "org.jbpm.process.instance.ProcessInstance.configureTimers()" because "jbpmProcessInstance" is null
org.kie.persistence.postgresql.PostgresqlProcessInstancesWithLockIT.testBasicFlow Cannot invoke "org.jbpm.process.instance.ProcessInstance.configureTimers()" because "jbpmProcessInstance" is null
org.kie.persistence.postgresql.PostgresqlProcessInstancesWithLockIT.testMultipleProcesses Cannot invoke "org.jbpm.process.instance.ProcessInstance.configureTimers()" because "jbpmProcessInstance" is null
org.kie.persistence.postgresql.PostgresqlProcessInstancesWithLockIT.testProcessWithDifferentVersion Cannot invoke "org.jbpm.process.instance.ProcessInstance.configureTimers()" because "jbpmProcessInstance" is null
org.kie.persistence.postgresql.PostgresqlProcessInstancesWithLockIT.testRemove Cannot invoke "org.jbpm.process.instance.ProcessInstance.configureTimers()" because "jbpmProcessInstance" is null
org.kie.persistence.postgresql.PostgresqlProcessInstancesWithLockIT.testUpdate Cannot invoke "org.jbpm.process.instance.ProcessInstance.configureTimers()" because "jbpmProcessInstance" is null
fjtirado commented 1 week ago

Tries a first commit that read state from process insance if process instance is not null. Not working, because disconnected process instance are not null, and if set to null, it causes side effect on persistece module, Try altering the order of listeners.