Skip to content

Commit dbd9019

Browse files
committed
test: vsock: Suppress timeout exceptions seen on unconfigured systems
Seen on S390x Linux emulation.
1 parent ed0488b commit dbd9019

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

junixsocket-vsock/src/test/java/org/newsclub/net/unix/vsock/CancelAcceptTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@
1717
*/
1818
package org.newsclub.net.unix.vsock;
1919

20+
import java.net.SocketTimeoutException;
21+
22+
import org.junit.jupiter.api.Test;
2023
import org.newsclub.net.unix.AFSocketCapability;
2124
import org.newsclub.net.unix.AFSocketCapabilityRequirement;
2225
import org.newsclub.net.unix.AFVSOCKSocketAddress;
2326

2427
import com.kohlschutter.annotations.compiletime.SuppressFBWarnings;
28+
import com.kohlschutter.testutil.TestAbortedWithImportantMessageException;
29+
import com.kohlschutter.testutil.TestAbortedWithImportantMessageException.MessageType;
2530

2631
@AFSocketCapabilityRequirement(AFSocketCapability.CAPABILITY_VSOCK)
2732
@SuppressFBWarnings("NM_SAME_SIMPLE_NAME_AS_SUPERCLASS")
@@ -31,4 +36,17 @@ public final class CancelAcceptTest extends
3136
public CancelAcceptTest() {
3237
super(AFVSOCKAddressSpecifics.INSTANCE);
3338
}
39+
40+
@Test
41+
@Override
42+
public void issue6test1() throws Exception {
43+
try {
44+
super.issue6test1();
45+
} catch (SocketTimeoutException e) {
46+
throw new TestAbortedWithImportantMessageException(
47+
MessageType.TEST_ABORTED_SHORT_INFORMATIONAL,
48+
"Environment may not be configured for VSOCK. More information at https://kohlschutter.github.io/junixsocket/junixsocket-vsock/",
49+
e);
50+
}
51+
}
3452
}

junixsocket-vsock/src/test/java/org/newsclub/net/unix/vsock/TcpNoDelayTest.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@
1717
*/
1818
package org.newsclub.net.unix.vsock;
1919

20+
import java.net.SocketTimeoutException;
21+
22+
import org.junit.jupiter.api.Test;
2023
import org.newsclub.net.unix.AFSocketCapability;
2124
import org.newsclub.net.unix.AFSocketCapabilityRequirement;
2225
import org.newsclub.net.unix.AFVSOCKSocketAddress;
2326

2427
import com.kohlschutter.annotations.compiletime.SuppressFBWarnings;
28+
import com.kohlschutter.testutil.TestAbortedWithImportantMessageException;
29+
import com.kohlschutter.testutil.TestAbortedWithImportantMessageException.MessageType;
2530

2631
@AFSocketCapabilityRequirement(AFSocketCapability.CAPABILITY_VSOCK)
2732
@SuppressFBWarnings("NM_SAME_SIMPLE_NAME_AS_SUPERCLASS")
@@ -31,4 +36,30 @@ public final class TcpNoDelayTest extends
3136
public TcpNoDelayTest() {
3237
super(AFVSOCKAddressSpecifics.INSTANCE);
3338
}
39+
40+
@Test
41+
@Override
42+
public void testStrictImpl() throws Exception {
43+
try {
44+
super.testStrictImpl();
45+
} catch (SocketTimeoutException e) {
46+
throw new TestAbortedWithImportantMessageException(
47+
MessageType.TEST_ABORTED_SHORT_INFORMATIONAL,
48+
"Environment may not be configured for VSOCK. More information at https://kohlschutter.github.io/junixsocket/junixsocket-vsock/",
49+
e);
50+
}
51+
}
52+
53+
@Test
54+
@Override
55+
public void testDefaultImpl() throws Exception {
56+
try {
57+
super.testDefaultImpl();
58+
} catch (SocketTimeoutException e) {
59+
throw new TestAbortedWithImportantMessageException(
60+
MessageType.TEST_ABORTED_SHORT_INFORMATIONAL,
61+
"Environment may not be configured for VSOCK. More information at https://kohlschutter.github.io/junixsocket/junixsocket-vsock/",
62+
e);
63+
}
64+
}
3465
}

0 commit comments

Comments
 (0)