Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18073#discussion_r118152566
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormatSuite.scala
 ---
    @@ -26,6 +26,22 @@ import org.apache.spark.sql.test.SharedSQLContext
     
     class ParquetFileFormatSuite extends QueryTest with ParquetTest with 
SharedSQLContext {
     
    +  test("Number of threads doesn't grow extremely after parquet file 
reading") {
    +    withTempDir { dir =>
    +      val file = dir.toString + "/file"
    +      spark.range(1).toDF("a").coalesce(1).write.parquet(file)
    +      spark.read.parquet(file)
    +      val numThreadBefore = Thread.activeCount
    +      (1 to 100).map { _ =>
    +        spark.read.parquet(file)
    +      }
    +      val numThreadAfter = Thread.activeCount
    +      // Hard to test a correct thread number,
    +      // but it shouldn't increase more than a reasonable number.
    +      assert(numThreadAfter - numThreadBefore < 20)
    --- End diff --
    
    after waiting for enough time, can we expect this to be 0?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to