Re: [PR] CAMEL-19543 - camel-sjms2: replace Thread.sleep in tests. [camel]
orpiske merged PR #13685: URL: https://github.com/apache/camel/pull/13685 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] CAMEL-19543 - camel-sjms2: replace Thread.sleep in tests. [camel]
orpiske commented on code in PR #13685: URL: https://github.com/apache/camel/pull/13685#discussion_r1553211905 ## components/camel-sjms2/pom.xml: ## @@ -66,6 +66,12 @@ test test-jar + +org.awaitility +awaitility +${awaitility-version} +test + Review Comment: Thanks -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] CAMEL-19543 - camel-sjms2: replace Thread.sleep in tests. [camel]
VaishnaviR18 commented on code in PR #13685: URL: https://github.com/apache/camel/pull/13685#discussion_r1552838060 ## components/camel-sjms2/pom.xml: ## @@ -66,6 +66,12 @@ test test-jar + +org.awaitility +awaitility +${awaitility-version} +test + Review Comment: I have removed the dependency, can you please review it? Thanks! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] CAMEL-19543 - camel-sjms2: replace Thread.sleep in tests. [camel]
VaishnaviR18 commented on code in PR #13685: URL: https://github.com/apache/camel/pull/13685#discussion_r1552824216 ## components/camel-sjms2/pom.xml: ## @@ -66,6 +66,12 @@ test test-jar + +org.awaitility +awaitility +${awaitility-version} +test + Review Comment: Yes, sorry i missed it. Thanks! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] CAMEL-19543 - camel-sjms2: replace Thread.sleep in tests. [camel]
orpiske commented on code in PR #13685: URL: https://github.com/apache/camel/pull/13685#discussion_r1551043701 ## components/camel-sjms2/pom.xml: ## @@ -66,6 +66,12 @@ test test-jar + +org.awaitility +awaitility +${awaitility-version} +test + Review Comment: I believe this one is not necessary. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] CAMEL-19543 - camel-sjms2: replace Thread.sleep in tests. [camel]
VaishnaviR18 commented on code in PR #13685: URL: https://github.com/apache/camel/pull/13685#discussion_r1549629772 ## components/camel-sjms2/src/test/java/org/apache/camel/component/sjms2/consumer/InOnlyTopicDurableConsumerTest.java: ## @@ -25,13 +28,15 @@ import org.apache.camel.component.sjms2.support.Jms2TestSupport; import org.apache.camel.test.infra.artemis.services.ArtemisService; import org.apache.camel.test.infra.artemis.services.ArtemisServiceFactory; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.messaginghub.pooled.jms.JmsPoolConnectionFactory; public class InOnlyTopicDurableConsumerTest extends Jms2TestSupport { private static final String CONNECTION_ID = "test-connection-1"; +private CountDownLatch latch = new CountDownLatch(1); Review Comment: I have changed it to 2 . Thanks! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] CAMEL-19543 - camel-sjms2: replace Thread.sleep in tests. [camel]
davsclaus commented on code in PR #13685: URL: https://github.com/apache/camel/pull/13685#discussion_r1549620216 ## components/camel-sjms2/src/test/java/org/apache/camel/component/sjms2/consumer/InOnlyTopicDurableConsumerTest.java: ## @@ -25,13 +28,15 @@ import org.apache.camel.component.sjms2.support.Jms2TestSupport; import org.apache.camel.test.infra.artemis.services.ArtemisService; import org.apache.camel.test.infra.artemis.services.ArtemisServiceFactory; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.messaginghub.pooled.jms.JmsPoolConnectionFactory; public class InOnlyTopicDurableConsumerTest extends Jms2TestSupport { private static final String CONNECTION_ID = "test-connection-1"; +private CountDownLatch latch = new CountDownLatch(1); Review Comment: Should the count be 2 instead of 1 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] CAMEL-19543 - camel-sjms2: replace Thread.sleep in tests. [camel]
VaishnaviR18 commented on code in PR #13685: URL: https://github.com/apache/camel/pull/13685#discussion_r1549617761 ## components/camel-sjms2/src/test/java/org/apache/camel/component/sjms2/consumer/InOnlyTopicDurableConsumerTest.java: ## @@ -49,9 +53,8 @@ public void testDurableTopic() throws Exception { mock2.expectedBodiesReceived("Hello World"); // wait a bit and send the message -Thread.sleep(1000); - -template.sendBody("sjms2:topic:foo", "Hello World"); +Awaitility.await().pollDelay(1, TimeUnit.SECONDS).untilAsserted(() -> Assertions Review Comment: @davsclaus i have updated the code. Can you please review it? Thanks! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] CAMEL-19543 - camel-sjms2: replace Thread.sleep in tests. [camel]
VaishnaviR18 commented on code in PR #13685: URL: https://github.com/apache/camel/pull/13685#discussion_r1549420173 ## components/camel-sjms2/src/test/java/org/apache/camel/component/sjms2/consumer/InOnlyTopicDurableConsumerTest.java: ## @@ -49,9 +53,8 @@ public void testDurableTopic() throws Exception { mock2.expectedBodiesReceived("Hello World"); // wait a bit and send the message -Thread.sleep(1000); - -template.sendBody("sjms2:topic:foo", "Hello World"); +Awaitility.await().pollDelay(1, TimeUnit.SECONDS).untilAsserted(() -> Assertions Review Comment: Oh okay, thanks! I will see if there is any other way to replace thread.sleep. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] CAMEL-19543 - camel-sjms2: replace Thread.sleep in tests. [camel]
davsclaus commented on code in PR #13685: URL: https://github.com/apache/camel/pull/13685#discussion_r1549329149 ## components/camel-sjms2/src/test/java/org/apache/camel/component/sjms2/consumer/InOnlyTopicDurableConsumerTest.java: ## @@ -49,9 +53,8 @@ public void testDurableTopic() throws Exception { mock2.expectedBodiesReceived("Hello World"); // wait a bit and send the message -Thread.sleep(1000); - -template.sendBody("sjms2:topic:foo", "Hello World"); +Awaitility.await().pollDelay(1, TimeUnit.SECONDS).untilAsserted(() -> Assertions Review Comment: This would not really work correct as you risk sending more than 1 message if this code is executed again by awaitability. So you cannot do this when you do `template.sendBody...` as that code is supposed to only be executed once. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[PR] CAMEL-19543 - camel-sjms2: replace Thread.sleep in tests. [camel]
VaishnaviR18 opened a new pull request, #13685: URL: https://github.com/apache/camel/pull/13685 Issue link - https://issues.apache.org/jira/browse/CAMEL-19543 # Target - [ ] I checked that the commit is targeting the correct branch (note that Camel 3 uses `camel-3.x`, whereas Camel 4 uses the `main` branch) # Tracking - [ ] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [ ] I checked that each commit in the pull request has a meaningful subject line and body. - [ ] I have run `mvn clean install -DskipTests` locally and I have committed all auto-generated changes -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] CAMEL-19543 - camel-sjms2: replace Thread.sleep in tests. [camel]
github-actions[bot] commented on PR #13685: URL: https://github.com/apache/camel/pull/13685#issuecomment-2034004099 :star2: Thank you for your contribution to the Apache Camel project! :star2: :robot: CI automation will test this PR automatically. :camel: Apache Camel Committers, please review the following items: * First-time contributors **require MANUAL approval** for the GitHub Actions to run * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot. * You can label PRs using `build-all`, `build-dependents`, `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR. * Build and test logs are available in the Summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary. * :warning: Be careful when sharing logs. Review their contents before sharing them publicly. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org