@@ -26,6 +26,10 @@ import NIOSSL
26
26
final class MQTTNIOTests : XCTestCase {
27
27
static let hostname = ProcessInfo . processInfo. environment [ " MOSQUITTO_SERVER " ] ?? " localhost "
28
28
29
+ func isVSCodeDebugging( ) -> Bool {
30
+ return ProcessInfo . processInfo. environment [ " VSCODE_PID " ] != nil
31
+ }
32
+
29
33
func testConnectWithWill( ) throws {
30
34
let client = self . createClient ( identifier: " testConnectWithWill " )
31
35
defer { XCTAssertNoThrow ( try client. syncShutdownGracefully ( ) ) }
@@ -89,6 +93,11 @@ final class MQTTNIOTests: XCTestCase {
89
93
}
90
94
91
95
func testSSLConnect( ) throws {
96
+ #if os(macOS)
97
+ // p12 loading crashes when debugger other than Xcode is attached
98
+ guard !isVSCodeDebugging( ) else { throw XCTSkip ( ) }
99
+ #endif
100
+
92
101
let client = try createSSLClient ( identifier: " testSSLConnect " )
93
102
defer { XCTAssertNoThrow ( try client. syncShutdownGracefully ( ) ) }
94
103
_ = try client. connect ( ) . wait ( )
@@ -97,6 +106,11 @@ final class MQTTNIOTests: XCTestCase {
97
106
}
98
107
99
108
func testWebsocketAndSSLConnect( ) throws {
109
+ #if os(macOS)
110
+ // p12 loading crashes when debugger other than Xcode is attached
111
+ guard !isVSCodeDebugging( ) else { throw XCTSkip ( ) }
112
+ #endif
113
+
100
114
let client = try createWebSocketAndSSLClient ( identifier: " testWebsocketAndSSLConnect " )
101
115
defer { XCTAssertNoThrow ( try client. syncShutdownGracefully ( ) ) }
102
116
_ = try client. connect ( ) . wait ( )
@@ -106,6 +120,11 @@ final class MQTTNIOTests: XCTestCase {
106
120
107
121
#if canImport(Network)
108
122
func testSSLConnectFromP12( ) throws {
123
+ #if os(macOS)
124
+ // p12 loading crashes when debugger other than Xcode is attached
125
+ guard !isVSCodeDebugging( ) else { throw XCTSkip ( ) }
126
+ #endif
127
+
109
128
let client = try MQTTClient (
110
129
host: Self . hostname,
111
130
port: 8883 ,
0 commit comments