diff --git a/tests/parametric/test_dynamic_configuration.py b/tests/parametric/test_dynamic_configuration.py index 62cb25a2e0c..24e3a9686c1 100644 --- a/tests/parametric/test_dynamic_configuration.py +++ b/tests/parametric/test_dynamic_configuration.py @@ -190,10 +190,13 @@ def set_and_wait_rc(test_agent: TestAgentAPI, config_overrides: dict[str, Any], """ rc_config = _create_rc_config(config_overrides) + # Remove stale events before setting new config + test_agent.clear() + _set_rc(test_agent, rc_config, config_id) # Wait for both the telemetry event and the RC apply status. - test_agent.wait_for_telemetry_event("app-client-configuration-change", clear=True) + test_agent.wait_for_telemetry_event("app-client-configuration-change") return test_agent.wait_for_rc_apply_state("APM_TRACING", state=RemoteConfigApplyState.ACKNOWLEDGED, clear=True)