Skip to content

Commit 0512979

Browse files
committed
Remove randomness from VT messaging tests
Re-enable VT JMS test
1 parent c60e23a commit 0512979

File tree

8 files changed

+14
-37
lines changed

8 files changed

+14
-37
lines changed

integration-tests/virtual-threads/amqp-virtual-threads/src/main/java/io/quarkus/it/vthreads/amqp/PriceConsumer.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ public CompletionStage<Void> consume(Message<Double> msg) {
2828
assertThatItRunsOnVirtualThread();
2929
assertThatItRunsOnADuplicatedContext();
3030
double price = msg.getPayload();
31-
if (price > 90.0) {
32-
alertService.alertMessage(price);
33-
}
31+
alertService.alertMessage(price);
3432
return msg.ack().thenAccept(x -> {
3533
assertThatItRunsOnADuplicatedContext();
3634
// While the ack always runs on event loop thread
@@ -43,9 +41,7 @@ public CompletionStage<Void> consume(Message<Double> msg) {
4341
public void consume(double price) {
4442
assertThatItRunsOnVirtualThread();
4543
assertThatItRunsOnADuplicatedContext();
46-
if (price > 90.0) {
47-
alertService.alert(price);
48-
}
44+
alertService.alert(price);
4945
}
5046

5147
Random r = new Random();

integration-tests/virtual-threads/amqp-virtual-threads/src/test/java/io/quarkus/it/vthreads/amqp/WireMockExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public Map<String, String> start() {
2424
wireMockServer.stubFor(post(urlEqualTo("/price/alert-message"))
2525
.willReturn(aResponse().withBody("ok")));
2626

27-
return Map.of("price-alert/mp-rest/url", wireMockServer.baseUrl());
27+
return Map.of("quarkus.rest-client.price-alert.url", wireMockServer.baseUrl());
2828
}
2929

3030
@Override

integration-tests/virtual-threads/jms-virtual-threads/pom.xml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@
3333
<groupId>io.quarkus</groupId>
3434
<artifactId>quarkus-smallrye-reactive-messaging</artifactId>
3535
</dependency>
36+
<!-- JMS connector not part of the Quarkus BOM -->
3637
<dependency>
3738
<groupId>io.smallrye.reactive</groupId>
3839
<artifactId>smallrye-reactive-messaging-jms</artifactId>
39-
<version>4.9.0</version>
40+
<version>4.10.1</version>
4041
</dependency>
4142
<dependency>
4243
<groupId>io.quarkus</groupId>
@@ -144,18 +145,6 @@
144145
<plugin>
145146
<groupId>org.apache.maven.plugins</groupId>
146147
<artifactId>maven-surefire-plugin</artifactId>
147-
<configuration>
148-
<!-- Flaky test -->
149-
<skip>true</skip>
150-
</configuration>
151-
</plugin>
152-
<plugin>
153-
<groupId>org.apache.maven.plugins</groupId>
154-
<artifactId>maven-failsafe-plugin</artifactId>
155-
<configuration>
156-
<!-- Flaky test -->
157-
<skip>true</skip>
158-
</configuration>
159148
</plugin>
160149
</plugins>
161150
</build>

integration-tests/virtual-threads/jms-virtual-threads/src/main/java/io/quarkus/it/vthreads/jms/PriceConsumer.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.quarkus.it.vthreads.jms;
22

3-
import static io.quarkus.it.vthreads.jms.AssertHelper.assertThatItDoesNotRunOnVirtualThread;
43
import static io.quarkus.it.vthreads.jms.AssertHelper.assertThatItRunsOnVirtualThread;
54

65
import java.util.Random;
@@ -27,19 +26,15 @@ public class PriceConsumer {
2726
public CompletionStage<Void> consume(Message<Double> msg) {
2827
assertThatItRunsOnVirtualThread();
2928
double price = msg.getPayload();
30-
if (price > 90.0) {
31-
alertService.alertMessage(price);
32-
}
33-
return msg.ack().thenAccept(x -> assertThatItDoesNotRunOnVirtualThread());
29+
alertService.alertMessage(price);
30+
return msg.ack();
3431
}
3532

3633
@Incoming("prices")
3734
@RunOnVirtualThread
3835
public void consume(double price) {
3936
assertThatItRunsOnVirtualThread();
40-
if (price > 90.0) {
41-
alertService.alert(price);
42-
}
37+
alertService.alert(price);
4338
}
4439

4540
Random r = new Random();

integration-tests/virtual-threads/kafka-virtual-threads/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@
8181
<artifactId>*</artifactId>
8282
</exclusion>
8383
</exclusions>
84-
</dependency> <dependency>
84+
</dependency>
85+
<dependency>
8586
<groupId>io.quarkus</groupId>
8687
<artifactId>quarkus-rest-client-reactive-deployment</artifactId>
8788
<version>${project.version}</version>

integration-tests/virtual-threads/kafka-virtual-threads/src/main/java/io/quarkus/it/vthreads/kafka/PriceConsumer.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ public CompletionStage<Void> consume(Message<Double> msg) {
2828
assertThatItRunsOnVirtualThread();
2929
assertThatItRunsOnADuplicatedContext();
3030
double price = msg.getPayload();
31-
if (price > 90.0) {
32-
alertService.alertMessage(price);
33-
}
31+
alertService.alertMessage(price);
3432
return msg.ack().thenAccept(x -> {
3533
assertThatItRunsOnADuplicatedContext();
3634
// While the ack always runs on event loop thread
@@ -43,9 +41,7 @@ public CompletionStage<Void> consume(Message<Double> msg) {
4341
public void consume(double price) {
4442
assertThatItRunsOnVirtualThread();
4543
assertThatItRunsOnADuplicatedContext();
46-
if (price > 90.0) {
47-
alertService.alert(price);
48-
}
44+
alertService.alert(price);
4945
}
5046

5147
Random r = new Random();

integration-tests/virtual-threads/kafka-virtual-threads/src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
price-alert/mp-rest/url=${test.url}
1+
quarkus.rest-client.price-alert.url=${test.url}
22
mp.messaging.incoming.prices.broadcast=true
33
mp.messaging.incoming.prices.auto.offset.reset=earliest
44
mp.messaging.outgoing.prices-out.topic=prices

integration-tests/virtual-threads/kafka-virtual-threads/src/test/java/io/quarkus/it/vthreads/kafka/WireMockExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public Map<String, String> start() {
2424
wireMockServer.stubFor(post(urlEqualTo("/price/alert-message"))
2525
.willReturn(aResponse().withBody("ok")));
2626

27-
return Map.of("price-alert/mp-rest/url", wireMockServer.baseUrl());
27+
return Map.of("quarkus.rest-client.price-alert.url", wireMockServer.baseUrl());
2828
}
2929

3030
@Override

0 commit comments

Comments
 (0)