Skip to content

Commit

Permalink
Fixing intermittent test failure
Browse files Browse the repository at this point in the history
Signed-off-by: tvallin <thibault.vallin@oracle.com>
  • Loading branch information
tvallin committed Mar 13, 2024
1 parent 937fc20 commit 23b9580
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
5 changes: 5 additions & 0 deletions tests/integration/jms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
<groupId>io.helidon.microprofile.messaging</groupId>
<artifactId>helidon-microprofile-messaging</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.logging</groupId>
<artifactId>helidon-logging-jul</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.helidon.messaging</groupId>
<artifactId>helidon-messaging-jms-shim</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2023 Oracle and/or its affiliates.
* Copyright (c) 2020, 2024 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,7 +32,7 @@

public class AbstractJmsTest {

static final String BROKER_URL = "vm://localhost?broker.persistent=false";
static final String BROKER_URL = "vm://localhost?broker.persistent=true";
static Session session;
static ConnectionFactory connectionFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
})
@AddConfigs({
@AddConfig(key = "mp.messaging.connector.helidon-jms.jndi.env-properties.java.naming.provider.url",
value = "vm://localhost?broker.persistent=false"),
value = "vm://localhost?broker.persistent=true"),
@AddConfig(key = "mp.messaging.connector.helidon-jms.jndi.env-properties.java.naming.factory.initial",
value = "org.apache.activemq.jndi.ActiveMQInitialContextFactory"),

Expand Down Expand Up @@ -101,18 +101,19 @@ void resendAckTestPart1(SeContainer cdi) {
List<String> testData = List.of("0", "1", "2", "NO_ACK-1", "NO_ACK-2", "NO_ACK-3");
produce(TEST_QUEUE_ACK, testData, m -> {});
mockConnector.outgoing("mock-conn-channel", String.class)
.awaitPayloads(Duration.ofSeconds(5), testData.toArray(String[]::new));
.awaitPayloads(Duration.ofMinutes(1), testData.toArray(String[]::new));
}

@Test
@Order(2)
void resendAckTestPart2(SeContainer cdi) {
MockConnector mockConnector = cdi.select(MockConnector.class, TEST_CONNECTOR_ANNOTATION).get();
MockConnector mockConnector = cdi.select(MockConnector.class, TEST_CONNECTOR_ANNOTATION).get();

//Check if not acked messages are redelivered
mockConnector.outgoing("mock-conn-channel", String.class)
.requestMax()
.awaitPayloads(Duration.ofSeconds(5), "NO_ACK-1", "NO_ACK-2", "NO_ACK-3");
//Check if not acked messages are redelivered
mockConnector.outgoing("mock-conn-channel", String.class)
.requestMax()
.awaitCount(Duration.ofMinutes(1), 1)
.awaitPayloads(Duration.ofMinutes(1), "NO_ACK-1", "NO_ACK-2", "NO_ACK-3");
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

@ServerTest
@TestMethodOrder(MethodOrderer.MethodName.class)
Expand Down Expand Up @@ -66,7 +64,6 @@ void testConversation100() throws Exception {
}

@Test
@DisabledOnOs(OS.WINDOWS)
void testConversation1000() throws Exception {
testConversation(WsConversation.createRandom(1000));
}
Expand Down

0 comments on commit 23b9580

Please # to comment.