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

    https://github.com/apache/spark/pull/6205#discussion_r32286302
  
    --- Diff: core/src/test/scala/org/apache/spark/rpc/RpcEnvSuite.scala ---
    @@ -162,9 +163,15 @@ abstract class RpcEnvSuite extends SparkFunSuite with 
BeforeAndAfterAll {
         val rpcEndpointRef = anotherEnv.setupEndpointRef("local", env.address, 
"ask-timeout")
         try {
           val e = intercept[Exception] {
    -        rpcEndpointRef.askWithRetry[String]("hello", 1 millis)
    +        rpcEndpointRef.askWithRetry[String]("hello", new RpcTimeout(1 
millis, shortProp))
           }
           assert(e.isInstanceOf[TimeoutException] || 
e.getCause.isInstanceOf[TimeoutException])
    +      e match {
    +        case te: TimeoutException =>
    +          assert(te.getMessage().contains(shortProp))
    +        case e: Exception =>
    +          assert(e.getCause().getMessage().contains(shortProp))
    --- End diff --
    
    ah, I see, that makes sense.  in that case, I kinda prefer we just 
`intercept[SparkException]` in the first place, and then check the cause & the 
cause's msg.  And maybe add a brief comment that `askWithRetry` always wraps 
with `SparkException` so we look at the cause to see the original exception.


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to