You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2014/04/15 19:38:50 UTC

git commit: SPARK-1501: Ensure assertions in Graph.apply are asserted.

Repository: spark
Updated Branches:
  refs/heads/master df3609179 -> 2580a3b1a


SPARK-1501: Ensure assertions in Graph.apply are asserted.

The Graph.apply test in GraphSuite had some assertions in a closure in
a graph transformation. As a consequence, these assertions never
actually executed.  Furthermore, these closures had a reference to
(non-serializable) test harness classes because they called assert(),
which could be a problem if we proactively check closure serializability
in the future.

This commit simply changes the Graph.apply test to collect the graph
triplets so it can assert about each triplet from a map method.

Author: William Benton <wi...@redhat.com>

Closes #415 from willb/graphsuite-nop-fix and squashes the following commits:

0b63658 [William Benton] Ensure assertions in Graph.apply are asserted.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/2580a3b1
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/2580a3b1
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/2580a3b1

Branch: refs/heads/master
Commit: 2580a3b1a06188fa97d9440d793c8835ef7384b0
Parents: df36091
Author: William Benton <wi...@redhat.com>
Authored: Tue Apr 15 10:38:42 2014 -0700
Committer: Reynold Xin <rx...@apache.org>
Committed: Tue Apr 15 10:38:42 2014 -0700

----------------------------------------------------------------------
 graphx/src/test/scala/org/apache/spark/graphx/GraphSuite.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/2580a3b1/graphx/src/test/scala/org/apache/spark/graphx/GraphSuite.scala
----------------------------------------------------------------------
diff --git a/graphx/src/test/scala/org/apache/spark/graphx/GraphSuite.scala b/graphx/src/test/scala/org/apache/spark/graphx/GraphSuite.scala
index 28d34dd..c65e366 100644
--- a/graphx/src/test/scala/org/apache/spark/graphx/GraphSuite.scala
+++ b/graphx/src/test/scala/org/apache/spark/graphx/GraphSuite.scala
@@ -62,7 +62,7 @@ class GraphSuite extends FunSuite with LocalSparkContext {
       assert( graph.edges.count() === rawEdges.size )
       // Vertices not explicitly provided but referenced by edges should be created automatically
       assert( graph.vertices.count() === 100)
-      graph.triplets.map { et =>
+      graph.triplets.collect.map { et =>
         assert((et.srcId < 10 && et.srcAttr) || (et.srcId >= 10 && !et.srcAttr))
         assert((et.dstId < 10 && et.dstAttr) || (et.dstId >= 10 && !et.dstAttr))
       }