[ https://issues.apache.org/jira/browse/CAMEL-19547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17739352#comment-17739352 ]
Arin Tripathi commented on CAMEL-19547: --------------------------------------- In XmppRouteChatIT, do we need to have thread.sleep()? I don't know what would be the awaility equivalent of {noformat} template.sendBody("direct:toConsumer", body1); Thread.sleep(50); template.sendBody("direct:toConsumer", body2);{noformat} > camel-xmpp: replace Thread.sleep in tests > ----------------------------------------- > > Key: CAMEL-19547 > URL: https://issues.apache.org/jira/browse/CAMEL-19547 > Project: Camel > Issue Type: Task > Components: camel-xmpp, tests > Affects Versions: 4.0.0 > Reporter: Otavio Rodolfo Piske > Priority: Minor > Labels: easy, help-wanted > > We have many tests which use Thread.sleep for synchronization. This is bug > prone and can introduce flakiness when running on environments with different > capacities. > Ideally we should replace these with: > * [Awaitility|http://www.awaitility.org/] > * Java's native syncronization mechanism (Latches, Phasers, Locks, etc) > * Nothing (i.e.; in some cases the sleep can simply be removed) > > -- This message was sent by Atlassian Jira (v8.20.10#820010)