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

[incubator-kie-issues-1324] Live reload does not work for KN CLI plugin #2074

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

treblereel
Copy link
Contributor

@treblereel treblereel commented Jun 21, 2024

@treblereel
Copy link
Contributor Author

The cause of this issue is that we continue to send the heartbeat when the CDI container is already shutting down and the PostgreSqlJobServiceManagementRepository is unable to obtain the PgPool. The fix involves stopping the heartbeat first (by checking isLeader()).

This issue can be easily reproduced using the examples/jbpm-compact-architecture-example with the command mvn clean package quarkus:dev -Pdevelopment. To trigger the rebuild just edit CandidateData.java or Offer.java and reload the http://localhost:8080/q/dev-ui/extensions

To verify the fix, build incubator-kie-kogito-apps followed by incubator-kie-tools, replacing 999-20240509-SNAPSHOT with 999-SNAPSHOT.

@treblereel
Copy link
Contributor Author

@ricardozanini ^^

@kie-ci3
Copy link
Contributor

kie-ci3 commented Jun 21, 2024

PR job #1 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-apps -u #2074 --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-apps-pr/job/PR-2074/1/display/redirect

Test results:

  • PASSED: 1664
  • FAILED: 1

Those are the test failures:

org.kie.kogito.index.ProcessDataIndexMongoDBIT.testProcessInstanceEvents 1 expectation failed.
JSON path errors doesn't match.
Expected: null
Actual: <[{message=Exception while fetching data (/UserTaskInstances[0]/schema) : Runtime service URL not defined, please review the kogito.service.url system property to point the public URL for this runtime., locations=[{line=1, column=85}], path=[UserTaskInstances, 0, schema], extensions={classification=DataFetchingException}}]>

@kie-ci3
Copy link
Contributor

kie-ci3 commented Jun 28, 2024

PR job #2 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-apps -u #2074 --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-apps-pr/job/PR-2074/2/display/redirect

Test results:

  • PASSED: 1664
  • FAILED: 1

Those are the test failures:

org.kie.kogito.index.service.InfinispanDomainIndexingServiceIT.testConcurrentProcessInstanceIndex Assertion condition defined as a org.kie.kogito.index.service.AbstractIndexingServiceIT 1 expectation failed.
JSON path data.ProcessInstances[0].state doesn't match.
Expected: is "COMPLETED"
Actual: ACTIVE
within 30 seconds.

@kie-ci3
Copy link
Contributor

kie-ci3 commented Jul 9, 2024

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-apps -u #2074 --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-apps-pr/job/PR-2074/3/display/redirect

Test results:

  • PASSED: 1661
  • FAILED: 4

Those are the test failures:

org.kie.kogito.index.infinispan.ProcessDataIndexInfinispanHttpIT.testProcessInstanceEvents 1 expectation failed.
JSON path data.UserTaskInstances[0].potentialGroups[0] doesn't match.
Expected: managers
Actual: null
org.kie.kogito.index.mongodb.ProcessDataIndexMongoDBHttpIT.testProcessInstanceEvents 1 expectation failed.
JSON path data.UserTaskInstances[0].potentialGroups[0] doesn't match.
Expected: managers
Actual: null
org.kie.kogito.index.mongodb.ProcessDataIndexMongoDBKafkaIT.testProcessInstanceEvents Cannot invoke method size() on null object
org.kie.kogito.index.ProcessDataIndexMongoDBIT.testProcessInstanceEvents Cannot invoke method size() on null object

@treblereel
Copy link
Contributor Author

@ricardozanini @wmedvede @dgutierr

From what I see, this error is not related to the PR. Moreover, the other PRs also contain the same error (3 out of 4). I agree with @domhanak, who suggests investigating this. WDYT?

@domhanak
Copy link

domhanak commented Jul 9, 2024

@treblereel where did I say that? :D unrelated flaky tests should be reported in an issue and we can disregard them :)

On the other hand, to test this with kn workflow plugin - do you have steps to build this with the CLI?
I assume Apps -> kie-tools is the order but not sure what is the current state of kie-tools and the weekly snapshot problem. Any clues?

EDIT: Turns out I can't read properly - To verify the fix, build incubator-kie-kogito-apps followed by incubator-kie-tools, replacing 999-20240509-SNAPSHOT with 999-SNAPSHOT.

Will check soon

@domhanak domhanak requested review from domhanak and removed request for fjtirado July 9, 2024 07:31
@domhanak
Copy link

domhanak commented Jul 9, 2024

@treblereel Worked well, I was able to finish the use case of live reload properly.
One thing that kinda alarms me is that we are not having any unit or integration test here to verify this issue.

Do you think we could add a test to check this cause: The cause of this issue is that we continue to send the heartbeat when the CDI container is already shutting down and the PostgreSqlJobServiceManagementRepository is unable to obtain the PgPool. Let me know please, we have testHeartbeat() and testConflictHeartbeat() in PostgreSqlJobServiceManagementRepositoryTest maybe we can expand it?

@treblereel
Copy link
Contributor Author

@domhanak here #1530 (comment) :)

hmm, for some unknown reason, it's green today :)

@domhanak
Copy link

domhanak commented Jul 10, 2024

@treblereel Yea sometimes the CI is slower, depends on the machine and some tests are flaky.

The comment you are referencing point to different PR, is that right?

@treblereel
Copy link
Contributor Author

@domhanak I don't think we need tests here, all we need is to check the fix is ok. Moreover, fwiv it's not that easy to write tests for this case. But if you think we need it, let me know, maybe we can merge it as is (in case fix is ok) and create a separate issue for tests

@domhanak
Copy link

Ack, created one for me for E2E here - apache/incubator-kie-issues#1380
If you have an idea how to check this on lower levels of testing please create something similar.
Thanks!

@domhanak domhanak merged commit 1291fa3 into apache:main Jul 12, 2024
5 checks passed
@treblereel
Copy link
Contributor Author

@domhanak thank you

rgdoliveira pushed a commit to rgdoliveira/kogito-apps that referenced this pull request Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Live reload does not work for KN CLI plugin
5 participants