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

    https://github.com/apache/spark/pull/18073#discussion_r118193060
  
    --- 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 --
    
    this looks hacky, can we think of a better way to test it? If not, I 
suggest to remove this test, as the fix is straightforward and we can verify it 
manually by some profile tools.


---
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