Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/20761#discussion_r175579431
--- Diff:
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala
---
@@ -35,17 +36,23 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration
import org.apache.hadoop.yarn.util.Records
import org.mockito.Matchers.{eq => meq, _}
import org.mockito.Mockito._
-import org.scalatest.Matchers
+import org.scalatest.{BeforeAndAfterAll, Matchers}
import org.apache.spark.{SparkConf, SparkFunSuite, TestUtils}
import org.apache.spark.deploy.yarn.config._
import org.apache.spark.util.{SparkConfWithEnv, Utils}
-class ClientSuite extends SparkFunSuite with Matchers {
+class ClientSuite extends SparkFunSuite with Matchers with
BeforeAndAfterAll {
import Client._
var oldSystemProperties: Properties = null
+ private var yarnResourceTypesAvailable = false
+
+ override def beforeAll(): Unit = {
+ super.beforeAll()
+ yarnResourceTypesAvailable =
ResourceTypeHelper.isYarnResourceTypesAvailable()
--- End diff --
Why not just inline `ResourceTypeHelper.isYarnResourceTypesAvailable()` in
the tests? That's a lot less code than what you have.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]