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

    https://github.com/apache/spark/pull/20761#discussion_r189882181
  
    --- Diff: 
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala
 ---
    @@ -199,6 +204,88 @@ class ClientSuite extends SparkFunSuite with Matchers {
         appContext.getMaxAppAttempts should be (42)
       }
     
    +  test("Resource type args propagate, resource type not defined") {
    +    assume(ResourceTypeHelper.isYarnResourceTypesAvailable())
    +    val sparkConf = new SparkConf()
    +      .set(YARN_AM_RESOURCE_TYPES_PREFIX + "gpu", "121m")
    +    val args = new ClientArguments(Array())
    +
    +    val appContext = 
Records.newRecord(classOf[ApplicationSubmissionContext])
    +    val getNewApplicationResponse = 
Records.newRecord(classOf[GetNewApplicationResponse])
    +    val containerLaunchContext = 
Records.newRecord(classOf[ContainerLaunchContext])
    +
    +    val client = new Client(args, sparkConf)
    +
    +    try {
    +      client.createApplicationSubmissionContext(
    +        new YarnClientApplication(getNewApplicationResponse, appContext),
    +        containerLaunchContext)
    +    } catch {
    +      case NonFatal(e) =>
    +        val expectedExceptionClass = 
"org.apache.hadoop.yarn.exceptions.ResourceNotFoundException"
    +        if (e.getClass.getName != expectedExceptionClass) {
    +          fail(s"Exception caught: $e is not an instance of 
$expectedExceptionClass!")
    +        }
    +    }
    +  }
    +
    +  test("Resource type args propagate (client mode)") {
    +    assume(ResourceTypeHelper.isYarnResourceTypesAvailable())
    +    TestYarnResourceTypeHelper.initializeResourceTypes(List("gpu", "fpga"))
    +
    +    val sparkConf = new SparkConf()
    +      .set(YARN_AM_RESOURCE_TYPES_PREFIX + "gpu", "121m")
    --- End diff --
    
    good point, fixed


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to