HwangDongJun commented on code in PR #58187:
URL: https://github.com/apache/spark/pull/58187#discussion_r4345284048


##########
resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/submit/ClientSuite.scala:
##########
@@ -223,12 +277,210 @@ class ClientSuite extends SparkFunSuite with 
BeforeAndAfter {
     val configMap = configMaps.head
     assert(configMap.getMetadata.getName ===
       KubernetesClientUtils.configMapNameDriver)
+    assert(configMap.getMetadata.getName === mountedConfigMapName)
     assert(configMap.getImmutable())
     assert(configMap.getData.containsKey(SPARK_CONF_FILE_NAME))
     
assert(configMap.getData.get(SPARK_CONF_FILE_NAME).contains("conf1key=conf1value"))
     
assert(configMap.getData.get(SPARK_CONF_FILE_NAME).contains("conf2key=conf2value"))
   }
 
+  test("SPARK-38079: the driver pod is created gated, and the gate is removed 
last") {
+    newClient().run()
+
+    val configMapName = KubernetesClientUtils.configMapNameDriver
+    assert(events.toSeq === Seq(
+      "list()", "apply",
+      "create pod",
+      "list()", "apply",
+      s"list(Secret/secret+owner,ConfigMap/$configMapName+owner)", "apply",

Review Comment:
   Confirmed and fixed. `ADDITIONAL_RESOURCES`, `PRE_RESOURCES`, 
`BUILT_KUBERNETES_SPEC` and `BUILT_KUBERNETES_SPEC_WITH_PRERES` are `def`s now, 
so every test gets objects that `run()` has not touched, and the test order no 
longer matters.
   
   I reproduced your first example: setting the owner reference on 
`Seq(configMap)` before the apply but on `driverKubernetesResources` only after 
it passed 17 of 17 before, and fails 6 tests now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to