File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -103,11 +103,16 @@ func (s *ProviderWatchTargetsTestSuite) TestKubeConfigClusterProvider() {
103103 })
104104
105105 s .Run ("Keeps watching for further changes" , func () {
106- s .kubeconfig .CurrentContext = "context-2"
107- s .Require ().NoError (clientcmd .WriteToFile (* s .kubeconfig , s .staticConfig .KubeConfig ))
106+ kubeconfig := * s .kubeconfig
107+ kubeconfig .CurrentContext = "context-2"
108+ s .Require ().NoError (clientcmd .WriteToFile (kubeconfig , s .staticConfig .KubeConfig ))
108109 s .Require ().NoError (waitForCallback (5 * time .Second ))
109110
110111 s .Run ("Replaces default target with new context" , func () {
112+ // In Windows systems, fsnotify may trigger multiple events for a single file change,
113+ s .Require ().NoError (test .WaitForCondition (5 * time .Second , func () bool {
114+ return provider .GetDefaultTarget () == "context-2"
115+ }))
111116 s .Equal ("context-2" , provider .GetDefaultTarget (), "Expected default target context to be updated" )
112117 })
113118 })
You can’t perform that action at this time.
0 commit comments