@@ -73,6 +73,13 @@ var _ = g.Describe("[sig-storage][FeatureGate:VSphereDriverConfiguration][Serial
7373 })
7474 o .Expect (err ).NotTo (o .HaveOccurred (), "failed to update ClusterCSIDriver" )
7575
76+ // Wait for operator to start progressing after config restore and settle in Progressing=False to ensure all
77+ // pod creation events complete before test ends.
78+ // This allows the pathological event matcher (newVsphereConfigurationTestsRollOutTooOftenEventMatcher in
79+ // pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go) to accurately attribute
80+ // pod events to this test's time window (interval); any events emitted later would not be matched.
81+ waitForStorageOperatorToSettle (ctx , oc )
82+
7683 e2e .Logf ("Successfully restored original driverConfig of ClusterCSIDriver" )
7784 })
7885
@@ -140,6 +147,7 @@ var _ = g.Describe("[sig-storage][FeatureGate:VSphereDriverConfiguration][Serial
140147 g .It (fmt .Sprintf ("%s" , t .name ), func () {
141148
142149 setClusterCSIDriverSnapshotOptions (ctx , oc , t .clusterCSIDriverOptions )
150+
143151 o .Eventually (func () error {
144152 return loadAndCheckCloudConf (ctx , oc , "Snapshot" , t .cloudConfigOptions , t .clusterCSIDriverOptions )
145153 }, pollTimeout , pollInterval ).Should (o .Succeed ())
@@ -150,6 +158,16 @@ var _ = g.Describe("[sig-storage][FeatureGate:VSphereDriverConfiguration][Serial
150158 })
151159})
152160
161+ // Wait for storage operator to settle after a configuration change.
162+ // This should be called right after a configuration change when we expect rollout of new pods.
163+ func waitForStorageOperatorToSettle (ctx context.Context , oc * exutil.CLI ) {
164+ e2e .Logf ("Waiting for storage operator to be Progressing=True" )
165+ o .Eventually (exutil .WaitForOperatorProgressingTrue (ctx , oc .AdminConfigClient (), "storage" )).WithTimeout (time .Second * 10 ).Should (o .Succeed ())
166+
167+ e2e .Logf ("Observing storage operator is settled in Progressing=False" )
168+ o .Consistently (exutil .WaitForOperatorProgressingFalse (ctx , oc .AdminConfigClient (), "storage" )).WithTimeout (time .Second * 10 ).Should (o .Succeed ())
169+ }
170+
153171func setClusterCSIDriverSnapshotOptions (ctx context.Context , oc * exutil.CLI , clusterCSIDriverOptions * opv1.VSphereCSIDriverConfigSpec ) {
154172 e2e .Logf ("updating ClusterCSIDriver driver config to: %+v" , clusterCSIDriverOptions )
155173
@@ -165,6 +183,8 @@ func setClusterCSIDriverSnapshotOptions(ctx context.Context, oc *exutil.CLI, clu
165183 return err
166184 }
167185
186+ waitForStorageOperatorToSettle (ctx , oc )
187+
168188 return nil
169189 })
170190 o .Expect (err ).NotTo (o .HaveOccurred (), "failed to update ClusterCSIDriver" )
0 commit comments