pbacsko commented on PR #683:
URL: https://github.com/apache/yunikorn-k8shim/pull/683#issuecomment-1781421783

   @chenyulin0719 Back then I added a solution to this problem for the 
admission controller tests:
   ```
                configMap.Data[amConf.AMAccessControlTrustControllers] = "false"
                ginkgo.By("Update configmap")
                stopChan := make(chan struct{})
                eventHandler := &EventHandler{updateCh: make(chan struct{})}
                err = 
kubeClient.StartConfigMapInformer(configmanager.YuniKornTestConfig.YkNamespace, 
stopChan, eventHandler)
                defer close(stopChan)
                gomega.Ω(err).ShouldNot(gomega.HaveOccurred())
                _, err = kubeClient.UpdateConfigMap(configMap, 
configmanager.YuniKornTestConfig.YkNamespace)
                gomega.Ω(err).ShouldNot(gomega.HaveOccurred())
                updateOk := eventHandler.WaitForUpdate(30 * time.Second)
   ```
   
   It's still not perfect because we can receive the update earlier than the 
controller, but the tests are fairly stable, I haven't seen any issues. Would 
you mind trying this out?
   


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

Reply via email to