Skip to content

Commit e220f08

Browse files
author
Phillip Webb
committed
Attempt to fix Windows CI
1 parent 8be3f33 commit e220f08

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.springframework.core.NestedCheckedException;
2323

2424
import com.mongodb.MongoServerSelectionException;
25+
import com.mongodb.MongoTimeoutException;
2526

2627
import static org.junit.Assert.assertTrue;
2728

@@ -55,7 +56,8 @@ private boolean serverNotRunning(IllegalStateException ex) {
5556
NestedCheckedException nested = new NestedCheckedException("failed", ex) {
5657
};
5758
Throwable root = nested.getRootCause();
58-
if (root instanceof MongoServerSelectionException) {
59+
if (root instanceof MongoServerSelectionException
60+
|| root instanceof MongoTimeoutException) {
5961
if (root.getMessage().contains("Unable to connect to any server")) {
6062
return true;
6163
}

0 commit comments

Comments
 (0)