Skip to content

Commit 09b4e44

Browse files
Nishad DeokarNishad Deokar
authored andcommitted
Assert the exact round-robin order in the starvation test
1 parent e61464b commit 09b4e44

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

Tests/NIOHTTP2Tests/OutboundFlowControlBufferTests.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -402,15 +402,11 @@ class OutboundFlowControlBufferTests: XCTestCase {
402402
self.buffer.streamCreated(streamID, initialWindowSize: 15)
403403
let frame = self.createDataFrame(streamID, byteBufferSize: 15)
404404
XCTAssertNoThrow(try self.buffer.processOutboundFrame(frame, promise: nil).assertNothing())
405+
self.buffer.flushReceived()
405406
}
406-
self.buffer.flushReceived()
407-
408-
let served = self.receivedFrames().map { $0.streamID }
409407

410408
// Every stream must be served once per round so that none can be starved.
411-
let firstRound = Array(served.prefix(streamIDs.count))
412-
XCTAssertEqual(Set(firstRound), Set(streamIDs))
413-
XCTAssertEqual(served, firstRound + firstRound + firstRound)
409+
XCTAssertEqual(self.receivedFrames().map { $0.streamID }, [1, 3, 5, 1, 3, 5, 1, 3, 5])
414410
}
415411

416412
func testRejectsPrioritySelfDependency() {

0 commit comments

Comments
 (0)