diff --git a/tests/debugger/test_debugger_inproduct_enablement.py b/tests/debugger/test_debugger_inproduct_enablement.py index d0c732ea753..56b57b73300 100644 --- a/tests/debugger/test_debugger_inproduct_enablement.py +++ b/tests/debugger/test_debugger_inproduct_enablement.py @@ -26,12 +26,13 @@ class Test_Debugger_InProduct_Enablement_Dynamic_Instrumentation(debugger.BaseDe """ def setup_inproduct_enablement_di(self): - def _send_config(*, enabled: bool | None = None, reset: bool = True): + def _send_config(*, enabled: bool | None = None, reset: bool = True, wait_installed: bool = False): probe = json.loads(self._probe_template) probe["id"] = debugger.generate_probe_id("log") self.set_probes([probe]) - self.send_rc_apm_tracing_and_probes(dynamic_instrumentation_enabled=enabled, reset=reset) + if wait_installed: + self.wait_for_all_probes(statuses=["INSTALLED"], timeout=TIMEOUT) self.send_weblog_request("/debugger/log") self.initialize_weblog_remote_config() @@ -41,10 +42,10 @@ def _send_config(*, enabled: bool | None = None, reset: bool = True): _send_config() self.di_initial_disabled = not self.wait_for_all_probes(statuses=["EMITTING"], timeout=TIMEOUT) - _send_config(enabled=True, reset=False) + _send_config(enabled=True, reset=False, wait_installed=context.library == "nodejs") self.di_explicit_enabled = self.wait_for_all_probes(statuses=["EMITTING"], timeout=TIMEOUT) - _send_config(reset=False) + _send_config(reset=False, wait_installed=context.library == "nodejs") self.di_empty_config = self.wait_for_all_probes(statuses=["EMITTING"], timeout=TIMEOUT) _send_config(enabled=False, reset=False) diff --git a/utils/_context/_scenarios/debugger.py b/utils/_context/_scenarios/debugger.py index 2d91293d594..613b3ef4d8a 100644 --- a/utils/_context/_scenarios/debugger.py +++ b/utils/_context/_scenarios/debugger.py @@ -39,6 +39,7 @@ def configure(self, config: pytest.Config): self.weblog_container.environment["DD_DYNAMIC_INSTRUMENTATION_UPLOAD_FLUSH_INTERVAL"] = "0.1" elif library == "nodejs": self.weblog_container.environment["DD_DYNAMIC_INSTRUMENTATION_UPLOAD_INTERVAL_SECONDS"] = "0.1" + self.weblog_container.environment["DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS"] = "0.2" elif library in ("java", "dotnet"): # Java and .NET use UPLOAD_FLUSH_INTERVAL in milliseconds self.weblog_container.environment["DD_DYNAMIC_INSTRUMENTATION_UPLOAD_FLUSH_INTERVAL"] = "100" diff --git a/utils/_context/_scenarios/endtoend.py b/utils/_context/_scenarios/endtoend.py index 3b276ebf344..662fd47dfe4 100644 --- a/utils/_context/_scenarios/endtoend.py +++ b/utils/_context/_scenarios/endtoend.py @@ -309,6 +309,9 @@ def configure(self, config: pytest.Config): library = self.weblog_infra.library_name + if library == "nodejs": + self.weblog_infra.http_container.environment.setdefault("DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS", "0.5") + if self._library_interface_timeout is None: if library == "java": self.library_interface_timeout = 25 diff --git a/utils/_remote_config.py b/utils/_remote_config.py index c8dd28f7976..399f5302c23 100644 --- a/utils/_remote_config.py +++ b/utils/_remote_config.py @@ -141,7 +141,8 @@ def remote_config_applied(data: dict) -> bool: library.wait_for(remote_config_applied, timeout=30) # ensure the library has enough time to apply the config to all subprocesses - time.sleep(2) + if context.library.name != "nodejs": + time.sleep(2) return current_states