From 9a39c3aaef5e7234c0012783f2b87111df79b550 Mon Sep 17 00:00:00 2001 From: Munir Abdinur Date: Mon, 28 Aug 2023 17:48:46 -0400 Subject: [PATCH] ci(telemetry): fix failing instrumentation telemetry test (#6779) Test failure was introduced in https://github.com/DataDog/dd-trace-py/commit/619c4bfb5e368dfea3ee152c611c7a8b590a8040 This fix was cherry-picked from the following commit: https://github.com/DataDog/dd-trace-py/pull/6712/commits/e738aa9a2a8cb0838bf090c2ead4d8637322043b ## Checklist - [x] Change(s) are motivated and described in the PR description. - [x] Testing strategy is described if automated tests are not included in the PR. - [x] Risk is outlined (performance impact, potential for breakage, maintainability, etc). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed. If no release note is required, add label `changelog/no-changelog`. - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [ ] Title is accurate. - [ ] No unnecessary changes are introduced. - [ ] Description motivates each change. - [ ] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [ ] Testing strategy adequately addresses listed risk(s). - [ ] Change is maintainable (easy to change, telemetry, documentation). - [ ] Release note makes sense to a user of the library. - [ ] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment. - [ ] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) - [ ] If this PR touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. - [ ] This PR doesn't touch any of that. --- tests/telemetry/test_writer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/telemetry/test_writer.py b/tests/telemetry/test_writer.py index c0ec5ee7339..ab792713c09 100644 --- a/tests/telemetry/test_writer.py +++ b/tests/telemetry/test_writer.py @@ -174,13 +174,14 @@ def test_app_started_event_configuration_override(test_agent_session, run_python assert status == 0, stderr events = test_agent_session.get_events() - events[0]["payload"]["configuration"].sort(key=lambda c: c["name"]) + assert len(events) == 1 + events[0]["payload"]["configuration"].sort(key=lambda c: c["name"]) assert events[0]["payload"]["configuration"] == [ {"name": "DD_APPSEC_ENABLED", "origin": "unknown", "value": False}, {"name": "DD_CALL_BASIC_CONFIG", "origin": "unknown", "value": True}, {"name": "DD_DATA_STREAMS_ENABLED", "origin": "unknown", "value": False}, - {"name": "DD_DYNAMIC_INSTRUMENTATION_ENABLED", "origin": "unknown", "value": False}, + {"name": "DD_DYNAMIC_INSTRUMENTATION_ENABLED", "origin": "unknown", "value": True}, {"name": "DD_EXCEPTION_DEBUGGING_ENABLED", "origin": "unknown", "value": True}, {"name": "DD_INSTRUMENTATION_TELEMETRY_ENABLED", "origin": "unknown", "value": True}, {"name": "DD_LOGS_INJECTION", "origin": "unknown", "value": True},