Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Tests/SwiftNetworkTests/SwiftNetworkQUICHarnessTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -572,11 +572,11 @@ final class SwiftNetworkQUICHarnessTests: NetTestCase {
// ACKs should be bundled on outgoing STREAM frames rather than going out in their own
// packet as much as possible, this test tracks that.
func testQUICEcho1MiBAckBundling() {
var packetSizes: [Int] = []
let observedPacketSizes = Mutex<[Int]>([])
let observeFrameHandler: BridgeObserveFrameHandler = { firstByte, byteCount in
// Identify short header packet to accumulate the total sizes at the end
guard (firstByte & 0xC0) == 0x40 else { return }
packetSizes.append(byteCount)
observedPacketSizes.withLock { $0.append(byteCount) }
}

QUICTestHarness().runQUICTest(
Expand All @@ -585,6 +585,7 @@ final class SwiftNetworkQUICHarnessTests: NetTestCase {
bridgeObserveFrameHandler: observeFrameHandler
)

let packetSizes = observedPacketSizes.withLock { $0 }
XCTAssertFalse(packetSizes.isEmpty, "packetSizes should not be empty")

// A standalone ACK (no STREAM data) fits comfortably under 100 bytes, but a
Expand Down
Loading