citrusframework / yaks

YAKS is a platform to enable Cloud Native BDD testing on Kubernetes
Apache License 2.0
82 stars 27 forks source link

Unable to lookup camel integration status in local mode #499

Open sacps001119 opened 3 weeks ago

sacps001119 commented 3 weeks ago

I am trying to run the local test with camel-k example on my VM.

$ yaks run integration.feature --local

The test will get stuck on TEST STEP 3: camel-k:verify-integration and retry to find the integration status until it times out or max attempt exceeded. The output log look like this:

...
DEBUG| TEST STEP 3: camel-k:verify-integration
INFO | Verify Camel K integration 'hello-world'
INFO | Waiting for integration 'hello-world' to be in state 'Running'
DEBUG| Full Camel JBang command is: -Dcamel.jbang.version=4.1.0 camel@apache/camel ps
DEBUG| Writing file resource: '878951-output.txt' (encoding is 'UTF-8')
INFO | Waiting for integration 'hello-world' to be in state 'Running'- retry in 5000 ms
DEBUG| Full Camel JBang command is: -Dcamel.jbang.version=4.1.0 camel@apache/camel ps
DEBUG| Writing file resource: '879084-output.txt' (encoding is 'UTF-8')
INFO | Waiting for integration 'hello-world' to be in state 'Running'- retry in 5000 ms
...

Also, when I run camel ps command, it shows the integration is in 'Running' status.

$ camel ps
  PID    NAME          READY  STATUS    AGE  
 878922  hello-world    1/1   Running  2m13s 
 879960  timer-to-log   1/1   Running   1m4s

Environment

OS: Red Hat Enterprise Linux release 8.8 (Ootpa) jbang version: 0.116.0 Camel version: 4.6.0 YAKS version: 0.19.2

A full set of the test project and log files are provided for investigation: yaks-camel-k-local-issue.zip

christophd commented 3 weeks ago

Thanks for reporting - I'll have a look ...

christophd commented 3 weeks ago

I just tried and the example runs successfully on my machine (Mac OS). I will have a look into your logs. Are you able to run any other example (e.g. hello-world.feature) locally?

sacps001119 commented 3 weeks ago

@christophd Is able to run hello-world.feature locally. helloworld_output_logs.zip

sacps001119 commented 2 weeks ago

I encountered the same problem in Maven test. I found that the getCamelProcessId method in ProcessAndOutput.java was returning the wrong PID. After disabling the logic for find the first descendant PID and returning the main PID, the test passed.

Use first descendant pid: mvn-test-descendant_pid-enable

Use main pid: mvn-test-descendant_pid-disable

log file: mvn-test-log.zip