Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing status flaky test #3777

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,6 @@ public void setState(final int state, String outcome) {

removeEventListeners();
processRuntime.getProcessInstanceManager().removeProcessInstance(this);
processRuntime.getProcessEventSupport().fireAfterProcessCompleted(this, kruntime);

if (isSignalCompletion()) {

List<KogitoEventListener> listeners = eventListeners.get("processInstanceCompleted:" + getStringId());
Expand All @@ -455,6 +453,8 @@ public void setState(final int state, String outcome) {

processRuntime.getSignalManager().signalEvent("processInstanceCompleted:" + getStringId(), this);
}
processRuntime.getProcessEventSupport().fireAfterProcessCompleted(this, kruntime);

} else {
super.setState(state, outcome);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,7 @@ public void testEventBasedSplit2() throws Exception {
org.kie.kogito.process.ProcessInstance<EventBasedSplit2Model> instanceTimer = processDefinition.createInstance(modelTimer);
instanceTimer.start();
assertThat(instanceTimer.status()).isEqualTo(org.kie.kogito.process.ProcessInstance.STATE_ACTIVE);
assertThat(countDownListener.waitTillCompleted(15000)).isTrue();
assertThat(instanceYes.status()).isEqualTo(org.kie.kogito.process.ProcessInstance.STATE_COMPLETED);
Copy link
Contributor Author

@fjtirado fjtirado Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a leffover, instanceYes has already being checked (btw, this probably makes the issue less frequent adding a small delay ;))
I also restored the timer to the default value (since that was not the issue)

assertThat(countDownListener.waitTillCompleted()).isTrue();
assertThat(instanceTimer.status()).isEqualTo(org.kie.kogito.process.ProcessInstance.STATE_COMPLETED);
}

Expand Down
Loading