You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(tests): use assert.CollectT in TestContainerCMDAgentMonitoringRuntimeExperimental (#11499) (#11511)
Updates TestContainerCMDAgentMonitoringRuntimeExperimental to use the assert.CollectT instead of the testing.T inside require.EventuallyWithT.
This prevents the code from failing on the first pass of require.EventuallyWithT. Now it retries transient assertion errors up to the timeout.
(cherry picked from commit f32807c)
Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
// Monitoring components should use the expected runtime
555
-
assert.Equalf(t, tc.expectedRuntimeName, compRuntime, "expected correct runtime name for monitoring component %s with id %s", comp.Name, comp.ID)
555
+
assert.Equalf(ct, tc.expectedRuntimeName, compRuntime, "expected correct runtime name for monitoring component %s with id %s", comp.Name, comp.ID)
556
556
case"http/metrics-monitoring":
557
557
// The comp.VersionInfo.Name for this component is empty at times.
558
558
// See https://github.com/elastic/elastic-agent/issues/11162.
559
559
default:
560
560
// Non-monitoring components should use the default runtime
561
-
assert.Equalf(t, string(component.DefaultRuntimeManager), compRuntime, "expected default runtime for non-monitoring component %s with id %s", comp.Name, comp.ID)
561
+
assert.Equalf(ct, string(component.DefaultRuntimeManager), compRuntime, "expected default runtime for non-monitoring component %s with id %s", comp.Name, comp.ID)
// Monitoring components should use the expected runtime
679
-
assert.Equalf(t, tc.expectedRuntimeName, compRuntime, "unexpected runtime name for monitoring component %s with id %s", comp.Name, comp.ID)
679
+
assert.Equalf(ct, tc.expectedRuntimeName, compRuntime, "unexpected runtime name for monitoring component %s with id %s", comp.Name, comp.ID)
680
680
case"http/metrics-monitoring":
681
681
// The comp.VersionInfo.Name for this component is empty at times.
682
682
// See https://github.com/elastic/elastic-agent/issues/11162.
683
683
default:
684
684
// Non-monitoring components should use the default runtime
685
-
assert.Equalf(t, string(component.DefaultRuntimeManager), compRuntime, "expected default runtime for non-monitoring component %s with id %s", comp.Name, comp.ID)
685
+
assert.Equalf(ct, string(component.DefaultRuntimeManager), compRuntime, "expected default runtime for non-monitoring component %s with id %s", comp.Name, comp.ID)
0 commit comments