[ 
https://issues.apache.org/jira/browse/ARTEMIS-1742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16498588#comment-16498588
 ] 

Andrea Tarocchi edited comment on ARTEMIS-1742 at 6/1/18 9:15 PM:
------------------------------------------------------------------

Hi [~jbertram], finally had the time to implement your suggestions and run the 
whole test suite.

Something has definitely improved: less flaky tests overall usually 1 or 2 per 
run but still the flaky one are random; suggesting there still might be some 
race condition issue going on?

On top of that I have 2 permanently failing test that I'll investigate, 
probably some difference between 2.30.0 and 2.5.0.


was (Author: valdar):
Hi [~jbertram], finally had the time to implement your suggestions and run the 
whole test suite.

Something has definitely improved: less flaky tests overall usually 1 or 2 per 
run but still the flaky one are random; suggesting there still might be some 
race condition issue going on?

On topo of that I have 2 permanently failing test that I'll investigate, 
probably some difference between 2.30.0 and 2.5.0.

> possible problem with embedded broker and vm acceptor/connector
> ---------------------------------------------------------------
>
>                 Key: ARTEMIS-1742
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1742
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.3.0
>            Reporter: Andrea Tarocchi
>            Priority: Major
>         Attachments: camel-jms.zip
>
>
> In camel-jms component we keep having some random failing tests using 
> embedded artemis broker.
> Basically the same tests are run using embedded artemis broker and embedded 
> amq broker and the same test is re ran up to 3 times if it has a failure (in 
> that case is marked as flaky), we keep experiencing flaky tests for artemis 
> and not for amq.
> I've attached a simplified as possible reproducer which run the same test 50 
> times only using artemis embedded broker (is a pretty simple write and read 
> from a temp queue).
> Running it a couple of times with: \{{mvn clean test}} should manifest the 
> flaky behaviour.
> Might be we init/destroy the embedded broker in the wrong way?
> {code:java}
>     public ConnectionFactory createConnectionFactory(final int 
> maximumRedeliveries, final boolean persistent) {
>         int id = BROKER_COUNT.incrementAndGet();
>         String baseDir = DATA_DIR + File.separator + id;
>         final Configuration configuration;
>         try {
>             configuration = new ConfigurationImpl()
>                 .setPersistenceEnabled(persistent)
>                 .setSecurityEnabled(false)
>                 .setBindingsDirectory(baseDir + File.separator + "bindings")
>                 .setJournalDirectory(baseDir + File.separator + "journal")
>                 .setPagingDirectory(baseDir + File.separator + "paging")
>                 .setLargeMessagesDirectory(baseDir + File.separator + 
> "largemessages")
>                     .setCheckForLiveServer(false)
>                     .setEnabledAsyncConnectionExecution(false)
>                     .setManagementNotificationAddress( new 
> SimpleString("activemq.notifications") )
>                     .setCheckForLiveServer(false)
>                     .setClusterConfigurations( new ArrayList<>() )
>                 .addAcceptorConfiguration("invm", "vm://" + id)
>                 .addConnectorConfiguration("invm", "vm://" + id);
>         } catch (final Exception e) {
>             throw new ExceptionInInitializerError(e);
>         }
>         final ConnectionFactoryConfiguration cfConfig = new 
> ConnectionFactoryConfigurationImpl().setName("cf")
>             .setConnectorNames("invm").setBindings("cf");
>         final JMSConfiguration jmsConfig = new JMSConfigurationImpl()
>             .setConnectionFactoryConfigurations(singletonList(cfConfig));
>         EmbeddedJMS broker = new 
> EmbeddedJMS().setConfiguration(configuration).setJmsConfiguration(jmsConfig);
>         try {
>             broker.start();
>         } catch (final Exception e) {
>             throw new ExceptionInInitializerError(e);
>         }
>         final AddressSettings addressSettings = new AddressSettings()
>                                                         
> .setMaxDeliveryAttempts(maximumRedeliveries)
>                                                         
> .setDeadLetterAddress(new SimpleString("jms.queue.deadletter"))
>                                                         .setExpiryAddress(new 
> SimpleString("jms.queue.expired"))
>                 .setAutoCreateAddresses(true)
>                                                         
> .setAutoCreateQueues(true);
>         
> broker.getActiveMQServer().getAddressSettingsRepository().addMatch("#", 
> addressSettings);
>         TransportConfiguration transportConfigs = new 
> TransportConfiguration(InVMConnectorFactory.class.getName());
>         
> transportConfigs.getParams().put(TransportConstants.SERVER_ID_PROP_NAME, id);
>         ServerLocator serviceLocator = 
> ActiveMQClient.createServerLocator(false, transportConfigs);
>         ActiveMQConnectionFactory acf = new 
> ActiveMQConnectionFactory(serviceLocator);
>         return acf;
>     }
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to