Skip to content

Commit

Permalink
Add test to ensure that overriding Yarn configs works.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcelo Vanzin committed Aug 27, 2014
1 parent 53f9506 commit 51e71cf
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ package org.apache.spark.deploy.yarn
import java.io.{File, IOException}

import com.google.common.io.{ByteStreams, Files}
import org.apache.hadoop.yarn.conf.YarnConfiguration
import org.scalatest.{FunSuite, Matchers}

import org.apache.spark.Logging
import org.apache.spark.{Logging, SparkConf}

class YarnSparkHadoopUtilSuite extends FunSuite with Matchers with Logging {

Expand Down Expand Up @@ -61,4 +62,16 @@ class YarnSparkHadoopUtilSuite extends FunSuite with Matchers with Logging {
}
}

test("Yarn configuration override") {
val key = "yarn.nodemanager.hostname"
val default = new YarnConfiguration()

val sparkConf = new SparkConf()
.set("spark.hadoop." + key, "someHostName")
val yarnConf = new YarnSparkHadoopUtil().newConfiguration(sparkConf)

yarnConf.getClass() should be (classOf[YarnConfiguration])
yarnConf.get(key) should not be default.get(key)
}

}

0 comments on commit 51e71cf

Please sign in to comment.