Instead of putting this at the bottom of a big "cogrouped RDD with locality" test, make it a separate test case. It will make it easier to see what's failing.