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

    https://github.com/apache/spark/pull/21199#discussion_r189111878
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/sources/TextSocketStreamSuite.scala
 ---
    @@ -256,7 +258,101 @@ class TextSocketStreamSuite extends StreamTest with 
SharedSQLContext with Before
         }
       }
     
    -  private class ServerThread extends Thread with Logging {
    +  test("continuous data") {
    +    serverThread = new ServerThread()
    +    serverThread.start()
    +
    +    val reader = new TextSocketContinuousReader(
    +      new DataSourceOptions(Map("numPartitions" -> "2", "host" -> 
"localhost",
    +        "port" -> serverThread.port.toString).asJava))
    +    reader.setStartOffset(Optional.empty())
    +    val tasks = reader.planInputPartitions()
    +    assert(tasks.size == 2)
    +
    +    val numRecords = 10
    +    val data = scala.collection.mutable.ListBuffer[Int]()
    +    val offsets = scala.collection.mutable.ListBuffer[Int]()
    +    import org.scalatest.time.SpanSugar._
    +    failAfter(5 seconds) {
    --- End diff --
    
    Probably we could use, but the `addSocketData` does not work for continuous 
source and thought the reader offsets could be validated better this way. 
(followed the approach in RateStreamProviderSuite)


---

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

Reply via email to