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

fix: Make sure to use current pid to verify Camel app status #1285

Closed
wants to merge 2 commits into from

Conversation

christophd
Copy link
Member

  • Auto adjust the pid that identifies the running Camel JBang application
  • Camel JBang pid may change on Unix OS due to descendant process being launched
  • Racing conditions may lead to parent pid being stored in test context
  • Make sure to also search for descendant process ids when verifying the Camel integration app status

gansheer and others added 2 commits December 18, 2024 14:16
- Auto adjust the pid that identifies the running Camel JBang application
- Camel JBang pid may change on Unix OS due to descendant process being launched
- Racing conditions may lead to parent pid being stored in test context
- Make sure to also search for descendant process ids when verifying the Camel integration app status
@gansheer
Copy link
Contributor

I still have the same issue:

2024-12-19 09:41:48.287|INFO |main|CamelRunIntegrationAction - Starting Camel integration 'hello-yaml' ...
2024-12-19 09:41:48.289|INFO |main|ProcessAndOutput - Checking process with pid 39409, app route.yaml and command Optional[/usr/bin/bash -c jbang -Dgreeting="Hello Camel" camel@apache/camel run --name hello-yaml --verbose /home/user1/work/sources/gansheer/citrus/endpoints/citrus-camel/target/test-classes/org/citrusframework/camel/integration/route.yaml].
2024-12-19 09:41:48.289|INFO |main|ProcessAndOutput - Checking process with pid 39409, app route.yaml and command Optional[/usr/bin/bash -c jbang -Dgreeting="Hello Camel" camel@apache/camel run --name hello-yaml --verbose /home/user1/work/sources/gansheer/citrus/endpoints/citrus-camel/target/test-classes/org/citrusframework/camel/integration/route.yaml].
2024-12-19 09:41:48.420|INFO |main|ProcessAndOutput - Checking descendant process with pid 39418, app route.yaml and command Optional[/usr/lib/jvm/java-21-openjdk-21.0.5.0.11-1.fc41.x86_64/bin/java -classpath /home/user1/.jbang/bin/jbang.jar dev.jbang.Main -Dgreeting=Hello Camel camel@apache/camel run --name hello-yaml --verbose /home/user1/work/sources/gansheer/citrus/endpoints/citrus-camel/target/test-classes/org/citrusframework/camel/integration/route.yaml].
2024-12-19 09:41:48.421|INFO |main|CamelRunIntegrationAction - CamelRunIntegrationAction pid 39418.

We end up having the wrong pid set in the context that raise the following error in the Verify action:
[ERROR] shouldLoadCamelActions(org.citrusframework.camel.yaml.JBangTest) Time elapsed: 20.058 s <<< FAILURE! org.citrusframework.exceptions.TestCaseFailedException: Unknown variable 'hello-yaml:process:39409

@christophd christophd marked this pull request as draft December 19, 2024 09:05
@christophd christophd closed this Dec 19, 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.

2 participants