Skip to content

Commit

Permalink
pass new argument in both possible cases
Browse files Browse the repository at this point in the history
  • Loading branch information
emmettbutler committed Feb 6, 2024
1 parent 2f673db commit ee661c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ddapm_test_agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ async def handle_snapshot(self, request: Request) -> web.Response:
trace_snap_path_exists = os.path.exists(trace_snap_file)

received_traces = await self._traces_by_session(token)
count_tolerance = int(request.query.get("count_tolerance", 0))
if snap_ci_mode and received_traces and not trace_snap_path_exists:
raise AssertionError(
f"Trace snapshot file '{trace_snap_file}' not found. "
Expand All @@ -764,6 +765,7 @@ async def handle_snapshot(self, request: Request) -> web.Response:
expected_traces=raw_snapshot,
received_traces=received_traces,
ignored=span_ignores,
count_tolerance=count_tolerance,
)
elif received_traces:
# Create a new snapshot for the data received
Expand All @@ -786,9 +788,7 @@ async def handle_snapshot(self, request: Request) -> web.Response:
with open(tracestats_snap_file, mode="r") as f:
raw_snapshot = json.load(f)
tracestats_snapshot.snapshot(
expected_stats=raw_snapshot,
received_stats=received_stats,
count_tolerance=int(request.query.get("count_tolerance", 0)),
expected_stats=raw_snapshot, received_stats=received_stats, count_tolerance=count_tolerance
)
elif received_stats:
# Create a new snapshot for the data received
Expand Down

0 comments on commit ee661c4

Please sign in to comment.