attilapiros commented on a change in pull request #24080: 
[SPARK-27147][TEST]Create new unit test cases for SortShuffleWriter
URL: https://github.com/apache/spark/pull/24080#discussion_r270861604
 
 

 ##########
 File path: 
core/src/test/scala/org/apache/spark/shuffle/sort/SortShuffleWriterSuite.scala
 ##########
 @@ -90,9 +93,8 @@ class SortShuffleWriterSuite extends SparkFunSuite with 
SharedSparkContext with
     writer.stop(success = true)
     val dataFile = shuffleBlockResolver.getDataFile(shuffleId, 2)
     assert(dataFile.exists())
-    assert(dataFile.length() !== 0)
-    assert(context.taskMetrics().shuffleWriteMetrics.bytesWritten !== 0)
-    assert(context.taskMetrics().shuffleWriteMetrics.recordsWritten !== 0)
-    Utils.deleteRecursively(dataFile)
+    assert(dataFile.length() !== expected)
 
 Review comment:
   Use shuffle write metrics, like:
   
   ```scala
       val writeMetrics = context.taskMetrics().shuffleWriteMetrics
       assert(dataFile.length() === writeMetrics.bytesWritten)
       assert(context.taskMetrics().shuffleWriteMetrics.bytesWritten === 
writeMetrics.bytesWritten)
       assert(context.taskMetrics().shuffleWriteMetrics.recordsWritten === 
writeMetrics.recordsWritten)
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to