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

    https://github.com/apache/spark/pull/21634#discussion_r197839738
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsSuite.scala
 ---
    @@ -504,4 +504,38 @@ class SQLMetricsSuite extends SparkFunSuite with 
SQLMetricsTestUtils with Shared
       test("writing data out metrics with dynamic partition: parquet") {
         testMetricsDynamicPartition("parquet", "parquet", "t1")
       }
    +
    +  test("writing metrics from single thread") {
    +    val nAdds = 10
    +    val acc = new SQLMetric("test", -10)
    +    assert(acc.isZero())
    +    acc.set(0)
    +    for (i <- 1 to nAdds) acc.add(1)
    +    assert(!acc.isZero())
    +    assert(nAdds === acc.value)
    +    acc.reset()
    +    assert(acc.isZero())
    +  }
    +
    +  test("writing metrics from multiple threads") {
    --- End diff --
    
    Good question. Checking in a separate branch:
    org.scalatest.exceptions.TestFailedException: 100000 did not equal 56544



---

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

Reply via email to