Skip to content

Commit

Permalink
Fix unit test consistency (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov authored Sep 28, 2023
1 parent a90e169 commit 48a66ab
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,11 @@ class YamuxHandlerTest : MuxHandlerAbstractTest() {

val range = 1..messagesToSend

// 100 window updates should be sent to ensure buffer is flushed and all messages are sent so will send them at random times
val windowUpdatesIndices = (range).shuffled().take(100).toSet()
// 100 window updates should be sent to ensure buffer is flushed and all messages are sent
// so will send them at random times ensuring maxBufferedConnectionWrites can never be reached
val windowUpdatesIndices = (range).chunked(100).flatMap {
it.shuffled().take(20)
}

for (i in range) {
if (i in windowUpdatesIndices) {
Expand Down

0 comments on commit 48a66ab

Please sign in to comment.