Skip to content

Commit b3acb6d

Browse files
committed
Filter by destination port before asserting
1 parent c33257f commit b3acb6d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ios/MullvadVPNUITests/RelayTests.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,12 @@ class RelayTests: LoggedInWithTimeUITestCase {
194194
.tapDisconnectButton()
195195
let capturedStreams = stopPacketCapture()
196196

197+
// The capture will contain several streams where `other_addr` contains the IP the device connected to
198+
// One stream will be for the source port, the other for the destination port
197199
let streamFromPeeerToRelay = try XCTUnwrap(
198-
capturedStreams
199-
.filter { $0.destinationAddress == connectedToIPAddress }.first
200+
capturedStreams.filter { $0.destinationAddress == connectedToIPAddress && $0.destinationPort == 80 }.first
200201
)
201202

202-
XCTAssertTrue(streamFromPeeerToRelay.destinationPort == 80)
203203
XCTAssertTrue(streamFromPeeerToRelay.transportProtocol == .TCP)
204204
}
205205

0 commit comments

Comments
 (0)