rajinisivaram commented on a change in pull request #8705: URL: https://github.com/apache/kafka/pull/8705#discussion_r431697371
########## File path: core/src/test/scala/unit/kafka/network/SocketServerTest.scala ########## @@ -1875,6 +1889,14 @@ class SocketServerTest { cachedCompletedReceives.update(super.completedReceives.asScala.toBuffer) cachedCompletedSends.update(super.completedSends.asScala) cachedDisconnected.update(super.disconnected.asScala.toBuffer) + + val map: util.Map[String, NetworkReceive] = JTestUtils.fieldValue(this, classOf[Selector], "completedReceives") + cachedCompletedReceives.currentPollValues.foreach { receive => + val channelOpt = Option(super.channel(receive.source)).orElse(Option(super.closingChannel(receive.source))) + channelOpt.foreach { channel => map.put(channel.id, receive) } + } + cachedCompletedSends.currentPollValues.foreach(super.completedSends.add) + cachedDisconnected.currentPollValues.foreach { case (id, state) => super.disconnected.put(id, state) } Review comment: I have moved the second line that updates current result into `update()`. They were done separately because each type uses slightly different format, but it is clearer if they are together. Added comments as well. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org