Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6830#discussion_r33554843
  
    --- Diff: 
external/flume/src/test/scala/org/apache/spark/streaming/flume/FlumePollingStreamSuite.scala
 ---
    @@ -89,146 +81,55 @@ class FlumePollingStreamSuite extends SparkFunSuite 
with BeforeAndAfter with Log
       }
     
       private def testFlumePolling(): Unit = {
    -    // Start the channel and sink.
    -    val context = new Context()
    -    context.put("capacity", channelCapacity.toString)
    -    context.put("transactionCapacity", "1000")
    -    context.put("keep-alive", "0")
    -    val channel = new MemoryChannel()
    -    Configurables.configure(channel, context)
    -
    -    val sink = new SparkSink()
    -    context.put(SparkSinkConfig.CONF_HOSTNAME, "localhost")
    -    context.put(SparkSinkConfig.CONF_PORT, String.valueOf(0))
    -    Configurables.configure(sink, context)
    -    sink.setChannel(channel)
    -    sink.start()
    -
    -    writeAndVerify(Seq(sink), Seq(channel))
    -    assertChannelIsEmpty(channel)
    -    sink.stop()
    -    channel.stop()
    +    try {
    +      val port = utils.startSingleSink()
    +
    +      writeAndVerify(Seq(port))
    +      utils.assertChannelsAreEmpty()
    +    } finally {
    +      utils.close()
    --- End diff --
    
    Isnt this better done in scala tests `after`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to