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

    https://github.com/apache/spark/pull/6707#discussion_r52854163
  
    --- Diff: 
streaming/src/test/scala/org/apache/spark/streaming/ReceivedBlockHandlerSuite.scala
 ---
    @@ -174,6 +176,130 @@ class ReceivedBlockHandlerSuite
         }
       }
     
    +  test("Test Block - count messages") {
    --- End diff --
    
    This is an example of a testing anti-pattern which I've seen a lot: this 
test is actually testing two completely independent cases, one with a 
BlockManager-based block handler and another with a WAL-based handler. As a 
result, this deserves to be _two_ `test` cases so that they can fail 
independently. As things stand now, a bug could introduce a change which causes 
only the BlockManager case to fail and that would cause the second test to be 
skipped rather than run.
    
    The fact that this test is four lines and half of the lines are comments 
explaining the two cases is another hint that this should be two separate 
tests, since then the name in `test()` could explain the cases.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to