Skip to content

Commit 5d799fe

Browse files
committed
Add comment to justify testing of getNarrowAncestors with cycles
1 parent 9d0e2b8 commit 5d799fe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,12 @@ class RDDSuite extends FunSuite with SharedSparkContext {
638638
assert(ancestors9.count(_.isInstanceOf[MappedValuesRDD[_, _, _]]) === 1)
639639
}
640640

641+
/**
642+
* This tests for the pathological condition in which the RDD dependency graph is cyclical.
643+
*
644+
* Since RDD is part of the public API, applications may actually implement RDDs that allow
645+
* such graphs to be constructed. In such cases, getNarrowAncestor should not simply hang.
646+
*/
641647
test("getNarrowAncestors with cycles") {
642648
val rdd1 = new CyclicalDependencyRDD[Int]
643649
val rdd2 = new CyclicalDependencyRDD[Int]

0 commit comments

Comments
 (0)