camel-quarkus icon indicating copy to clipboard operation
camel-quarkus copied to clipboard

Improve test coverage for scheduler component

Open aldettinger opened this issue 3 years ago • 4 comments

aldettinger avatar Oct 12 '22 16:10 aldettinger

@svkcemk We generally create a ticket unless this is very trivial changes. The ticket can be referenced in the commit by including "#4175" in the comment.

For traceability purpose, let's state that the PR was #4133 and the commit merged to main is this one: https://github.com/apache/camel-quarkus/commit/d72e4fb41bae0ff0d9395e7fdbd4e7cbae96246c

The PR has been labelled with backport_2.13.x, so it will be present in next 2.13.x release, probably 2.13.1.

From there @svkcemk, is there any work left in this ticket, like deleting a useless branch, update some docs or opening any follow up issues ? If not, we gonna set the milestone and close this issue.

@jamesnetherton Note that I'm not able to assign this ticket to souvik. Is there anything to tune in the repository ?

aldettinger avatar Oct 12 '22 16:10 aldettinger

@jamesnetherton Note that I'm not able to assign this ticket to souvik.

Me neither. Pretty sure I could in the past though.....

jamesnetherton avatar Oct 13 '22 07:10 jamesnetherton

Actually, I think for it to work, the user has to interact with the issue. So if @svkcemk adds a comment, I think he will show up in the assignee list.

jamesnetherton avatar Oct 13 '22 07:10 jamesnetherton

@aldettinger please keep it open I am going to raise another PR to add tests for : forcing scheduler to be idle

svkcemk avatar Oct 13 '22 07:10 svkcemk

Thought I'd report this here. There may be some flakiness with SchedulerTest.testDelay. I noticed it failed on a recent CI run.

2022-10-14T05:47:48.2823783Z [INFO] Running org.apache.camel.quarkus.component.scheduler.it.SchedulerTest
2022-10-14T05:47:55.2012641Z 2022-10-14 05:47:55,097 WARN  [io.qua.arc.dep.SplitPackageProcessor] (build-90) Detected a split package usage which is considered a bad practice and should be avoided. Following packages were detected in multiple archives: 
2022-10-14T05:47:55.2014064Z - "org.apache.camel.vault" found in [org.apache.camel:camel-api::jar, org.apache.camel:camel-main::jar]
2022-10-14T05:47:56.5113169Z 2022-10-14 05:47:56,498 WARN  [io.qua.config] (main) Unrecognized configuration key "quarkus.https.test-port" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
2022-10-14T05:47:56.5114957Z 2022-10-14 05:47:56,507 WARN  [io.qua.config] (main) Unrecognized configuration key "quarkus.version" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
2022-10-14T05:47:57.1850153Z 2022-10-14 05:47:57,184 INFO  [org.apa.cam.qua.cor.CamelBootstrapRecorder] (main) Bootstrap runtime: org.apache.camel.quarkus.main.CamelMainRuntime
2022-10-14T05:47:57.1888123Z 2022-10-14 05:47:57,187 INFO  [org.apa.cam.mai.MainSupport] (main) Apache Camel (Main) 3.19.0 is starting
2022-10-14T05:47:57.4813683Z 2022-10-14 05:47:57,480 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 3.19.0 (camel-1) is starting
2022-10-14T05:47:57.5587645Z 2022-10-14 05:47:57,556 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Routes startup (started:5)
2022-10-14T05:47:57.5589236Z 2022-10-14 05:47:57,556 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main)     Started route1 (scheduler://withInitialDelay)
2022-10-14T05:47:57.5590442Z 2022-10-14 05:47:57,556 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main)     Started route2 (scheduler://withDelay)
2022-10-14T05:47:57.5599730Z 2022-10-14 05:47:57,556 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main)     Started route3 (scheduler://useFixedDelay)
2022-10-14T05:47:57.5600970Z 2022-10-14 05:47:57,556 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main)     Started route4 (scheduler://withDelayRepeat)
2022-10-14T05:47:57.5601830Z 2022-10-14 05:47:57,556 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main)     Started route5 (scheduler://greedy)
2022-10-14T05:47:57.5602943Z 2022-10-14 05:47:57,556 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 3.19.0 (camel-1) started in 216ms (build:0ms init:140ms start:76ms)
2022-10-14T05:47:57.8276605Z 2022-10-14 05:47:57,825 INFO  [io.quarkus] (main) camel-quarkus-integration-test-scheduler 2.14.0-SNAPSHOT on JVM (powered by Quarkus 999-SNAPSHOT) started in 4.845s. Listening on: http://localhost:40433
2022-10-14T05:47:57.8277619Z 2022-10-14 05:47:57,825 INFO  [io.quarkus] (main) Profile test activated. 
2022-10-14T05:47:57.8278788Z 2022-10-14 05:47:57,826 INFO  [io.quarkus] (main) Installed features: [camel-core, camel-scheduler, cdi, resteasy, smallrye-context-propagation, vertx]
2022-10-14T05:48:01.6116884Z [ERROR] Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 13.325 s <<< FAILURE! - in org.apache.camel.quarkus.component.scheduler.it.SchedulerTest
2022-10-14T05:48:01.6121316Z [ERROR] testDelay  Time elapsed: 3.139 s  <<< ERROR!
2022-10-14T05:48:01.6122178Z org.awaitility.core.ConditionTimeoutException: Condition with org.apache.camel.quarkus.component.scheduler.it.SchedulerTest was not fulfilled within 2 seconds.
2022-10-14T05:48:01.6123130Z 	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
2022-10-14T05:48:01.6123882Z 	at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)
2022-10-14T05:48:01.6124509Z 	at org.awaitility.core.CallableCondition.await(CallableCondition.java:26)
2022-10-14T05:48:01.6125148Z 	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:985)
2022-10-14T05:48:01.6125843Z 	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:954)
2022-10-14T05:48:01.6128088Z 	at org.apache.camel.quarkus.component.scheduler.it.SchedulerTest.testDelay(SchedulerTest.java:40)

jamesnetherton avatar Oct 14 '22 07:10 jamesnetherton

Thanks @jamesnetherton checking..

svkcemk avatar Oct 14 '22 07:10 svkcemk

Not seeing this in local machine may be we can use a longer delay/timeout to test delay scheduler, what do you think ?

svkcemk avatar Oct 14 '22 07:10 svkcemk

Yes the CI might run very differently from a local machine, might be very slow or IO busy. Sometimes, it's possible to reproduce locally just by repeating: seq 30 | xargs -I INDEX mvn clean test -Dtest=xxx

On Fri, Oct 14, 2022 at 9:23 AM souvik ghosh @.***> wrote:

Not seeing this in local machine may be we can use a longer delay/timeout to test delay scheduler, what do you think ?

— Reply to this email directly, view it on GitHub https://github.com/apache/camel-quarkus/issues/4175#issuecomment-1278595236, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFJABNNLBJR5ZRWX2NXVE33WDEDALANCNFSM6AAAAAARDPBDOE . You are receiving this because you were mentioned.Message ID: @.***>

aldettinger avatar Oct 14 '22 07:10 aldettinger

I can replicate it consistently when running in a Docker container with restricted memory / CPU.

jamesnetherton avatar Oct 14 '22 07:10 jamesnetherton