Skip to content

Commit 2c7e36f

Browse files
authored
Merge pull request quarkusio#36240 from ozangunalp/improve_VT_messaging_flakiness
Improve Virtual Threads integration tests
2 parents a45cefb + eff619c commit 2c7e36f

File tree

44 files changed

+126
-962
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+126
-962
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
<artifactId>quarkus-junit5</artifactId>
3333
<scope>test</scope>
3434
</dependency>
35+
<dependency>
36+
<groupId>io.quarkus.junit5</groupId>
37+
<artifactId>junit5-virtual-threads</artifactId>
38+
<scope>test</scope>
39+
</dependency>
3540
<dependency>
3641
<groupId>io.rest-assured</groupId>
3742
<artifactId>rest-assured</artifactId>

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/NoPinningVerify.java

Lines changed: 0 additions & 76 deletions
This file was deleted.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@
1313

1414
import io.quarkus.test.common.QuarkusTestResource;
1515
import io.quarkus.test.junit.QuarkusTest;
16+
import io.quarkus.test.junit5.virtual.ShouldNotPin;
17+
import io.quarkus.test.junit5.virtual.VirtualThreadUnit;
1618

1719
@QuarkusTest
1820
@QuarkusTestResource(WireMockExtension.class)
21+
@VirtualThreadUnit
22+
@ShouldNotPin
1923
public class VirtualThreadTest {
2024

2125
public static final int EXPECTED_CALLS = 10;

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/grpc-virtual-threads/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
<artifactId>quarkus-junit5</artifactId>
2929
<scope>test</scope>
3030
</dependency>
31+
<dependency>
32+
<groupId>io.quarkus.junit5</groupId>
33+
<artifactId>junit5-virtual-threads</artifactId>
34+
<scope>test</scope>
35+
</dependency>
3136
<dependency>
3237
<groupId>io.rest-assured</groupId>
3338
<artifactId>rest-assured</artifactId>

integration-tests/virtual-threads/grpc-virtual-threads/src/test/java/io/quarkus/grpc/example/streaming/NoPinningVerify.java

Lines changed: 0 additions & 76 deletions
This file was deleted.

integration-tests/virtual-threads/grpc-virtual-threads/src/test/java/io/quarkus/grpc/example/streaming/VertxVirtualThreadTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
import io.quarkus.grpc.test.utils.VertxGRPCTestProfile;
44
import io.quarkus.test.junit.QuarkusTest;
55
import io.quarkus.test.junit.TestProfile;
6+
import io.quarkus.test.junit5.virtual.ShouldNotPin;
7+
import io.quarkus.test.junit5.virtual.VirtualThreadUnit;
68

79
@QuarkusTest
810
@TestProfile(VertxGRPCTestProfile.class)
11+
@VirtualThreadUnit
12+
@ShouldNotPin
913
public class VertxVirtualThreadTest extends VirtualThreadTestBase {
1014
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package io.quarkus.grpc.example.streaming;
22

33
import io.quarkus.test.junit.QuarkusTest;
4+
import io.quarkus.test.junit5.virtual.ShouldNotPin;
5+
import io.quarkus.test.junit5.virtual.VirtualThreadUnit;
46

57
@QuarkusTest
8+
@VirtualThreadUnit
9+
@ShouldNotPin
610
public class VirtualThreadTest extends VirtualThreadTestBase {
711
}

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

Lines changed: 7 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>
@@ -57,6 +58,11 @@
5758
<artifactId>quarkus-junit5</artifactId>
5859
<scope>test</scope>
5960
</dependency>
61+
<dependency>
62+
<groupId>io.quarkus.junit5</groupId>
63+
<artifactId>junit5-virtual-threads</artifactId>
64+
<scope>test</scope>
65+
</dependency>
6066
<dependency>
6167
<groupId>io.rest-assured</groupId>
6268
<artifactId>rest-assured</artifactId>
@@ -144,18 +150,6 @@
144150
<plugin>
145151
<groupId>org.apache.maven.plugins</groupId>
146152
<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>
159153
</plugin>
160154
</plugins>
161155
</build>

0 commit comments

Comments
 (0)