From e21356ec04b41cf23f3e938efe85592631dc0ba0 Mon Sep 17 00:00:00 2001 From: Liangzhou Yi <1934063+yiliangzhou@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:59:15 -0500 Subject: [PATCH] write traces received to output folder for debugging. --- tests/k8s_lib_injection/test_k8s_djm_with_ssi.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/k8s_lib_injection/test_k8s_djm_with_ssi.py b/tests/k8s_lib_injection/test_k8s_djm_with_ssi.py index 4852ba4245..674f992e02 100644 --- a/tests/k8s_lib_injection/test_k8s_djm_with_ssi.py +++ b/tests/k8s_lib_injection/test_k8s_djm_with_ssi.py @@ -1,6 +1,8 @@ import time import requests +import json + from utils import scenarios, features, context, irrelevant from utils.tools import logger from utils import scenarios, features @@ -39,7 +41,11 @@ def test_spark_instrumented_with_ssi(self, test_k8s_instance): traces_json = self._get_dev_agent_traces(test_k8s_instance.k8s_kind_cluster) - logger.debug(f"Traces received: {traces_json}") + logger.info(f"Traces received: {traces_json}") + # TODO: remove this once we have a better way to inspect traces + with open(f"{test_k8s_instance.output_folder}/traces.json", "w") as f: + f.write(json.dumps(traces_json, indent=4)) + assert len(traces_json) > 0, "No traces found" assert any("spark.application" in trace for trace in traces_json), "No spark.application traces found"