Skip to content

Commit a701e89

Browse files
authored
Incorrect VirtualThreadDeploymentTest.testExecuteBlocking (#5711)
The test checks thread names are not same (identical) but it should compare the contents. Signed-off-by: Thomas Segismont <[email protected]>
1 parent 2f11b16 commit a701e89

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

vertx-core/src/test/java/io/vertx/test/core/AsyncTestBase.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
import io.vertx.core.*;
1515
import io.vertx.core.Future;
16-
import io.vertx.core.internal.ContextInternal;
1716
import io.vertx.core.impl.Utils;
17+
import io.vertx.core.internal.ContextInternal;
1818
import io.vertx.core.internal.logging.Logger;
1919
import io.vertx.core.internal.logging.LoggerFactory;
2020
import org.hamcrest.Matcher;
@@ -505,6 +505,19 @@ protected void assertNotSame(String message, Object unexpected, Object actual) {
505505
}
506506
}
507507

508+
protected void assertNotEquals(Object unexpected, Object actual) {
509+
assertNotEquals(null, unexpected, actual);
510+
}
511+
512+
protected void assertNotEquals(String message, Object unexpected, Object actual) {
513+
checkThread();
514+
try {
515+
Assert.assertNotEquals(message, unexpected, actual);
516+
} catch (AssertionError e) {
517+
handleThrowable(e);
518+
}
519+
}
520+
508521
protected <T> void assertThat(String reason, T actual, Matcher<T> matcher) {
509522
checkThread();
510523
try {

vertx-core/src/test/java/io/vertx/tests/deployment/VirtualThreadDeploymentTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import java.util.Collections;
2525
import java.util.HashSet;
2626
import java.util.Set;
27-
import java.util.concurrent.ConcurrentMap;
2827
import java.util.concurrent.CountDownLatch;
2928
import java.util.concurrent.TimeUnit;
3029
import java.util.concurrent.atomic.AtomicBoolean;
@@ -91,7 +90,7 @@ public void start() {
9190
p.fail(e);
9291
return;
9392
}
94-
assertNotSame(Thread.currentThread().getName(), res);
93+
assertNotEquals(Thread.currentThread().getName(), res);
9594
p.complete();
9695
}
9796
}, new DeploymentOptions().setThreadingModel(ThreadingModel.VIRTUAL_THREAD)).await();

0 commit comments

Comments
 (0)