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

    https://github.com/apache/spark/pull/919#discussion_r13297439
  
    --- Diff: core/src/test/java/org/apache/spark/JavaAPISuite.java ---
    @@ -164,26 +176,26 @@ public void sortByKey() {
         Assert.assertEquals(new Tuple2<Integer, Integer>(3, 2), 
sortedPairs.get(2));
     
         // Custom comparator
    -    sortedRDD = rdd.sortByKey(new ReverseIntComparator(), false);
    +    sortedRDD = rdd.sortByKey(Collections.<Integer>reverseOrder(), false);
         Assert.assertEquals(new Tuple2<Integer, Integer>(-1, 1), 
sortedRDD.first());
         sortedPairs = sortedRDD.collect();
         Assert.assertEquals(new Tuple2<Integer, Integer>(0, 4), 
sortedPairs.get(1));
         Assert.assertEquals(new Tuple2<Integer, Integer>(3, 2), 
sortedPairs.get(2));
       }
     
    -  static int foreachCalls = 0;
    -
       @Test
       public void foreach() {
    -    foreachCalls = 0;
    +    final File tempDir = Files.createTempDir();
    --- End diff --
    
    Let me look into that. This was intended to be less fragile that relying on 
a class variable that happens to be shared, but maybe an accumulator is even 
more robust.


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

Reply via email to