Skip to content

Commit

Permalink
[SPARK-6980] Added UT for constructing RpcTimeout with default value
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanCutler committed Jun 11, 2015
1 parent d3754d1 commit 08f5afc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/test/scala/org/apache/spark/rpc/RpcEnvSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,13 @@ abstract class RpcEnvSuite extends SparkFunSuite with BeforeAndAfterAll {
val rt2 = RpcTimeout(conf, Seq("spark.ask.invalid.timeout", testProp, secondaryProp), "1s")
assert( testDurationSeconds === rt2.duration.toSeconds )

// Construct RpcTimeout with default value,
val defaultProp = "spark.ask.default.timeout"
val defaultDurationSeconds = 1
val rt3 = RpcTimeout(conf, Seq(defaultProp), defaultDurationSeconds.toString + "s")
assert( defaultDurationSeconds === rt3.duration.toSeconds )
assert( rt3.message.contains(defaultProp) )

// Try to construct RpcTimeout with an unconfigured property
intercept[Throwable] {
RpcTimeout(conf, "spark.ask.invalid.timeout")
Expand Down

0 comments on commit 08f5afc

Please sign in to comment.