Skip to content

Commit

Permalink
test(er): fix broken exception ID asserts
Browse files Browse the repository at this point in the history
The changes in #11772 broke ER tests that were relying on the old
exception ID tag. The rerun mechanism made the test pass on re-run so
the failure was not caught and the change was merged. Only the tests
were impacted, there was no impact on user-facing functionalities.
  • Loading branch information
P403n1x87 committed Jan 7, 2025
1 parent 232e2eb commit 848fe2b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/debugging/exception/test_replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def c(foo=42):
for n, span in enumerate(self.spans):
assert span.get_tag(replay.DEBUG_INFO_TAG) == "true"

exc_id = span.get_tag("_dd.debug.error.exception_id")
exc_id = span.get_tag(replay.EXCEPTION_ID_TAG)

info = {k: v for k, v in enumerate(["c", "b", "a"][n:], start=1)}

Expand All @@ -147,8 +147,8 @@ def c(foo=42):
assert all(str(s.exc_id) == exc_id for s in snapshots.values())

# assert all spans use the same exc_id
exc_ids = set(span.get_tag("_dd.debug.error.exception_id") for span in self.spans)
assert len(exc_ids) == 1
exc_ids = set(span.get_tag(replay.EXCEPTION_ID_TAG) for span in self.spans)
assert None not in exc_ids and len(exc_ids) == 1

def test_debugger_exception_chaining(self):
def a(v, d=None):
Expand Down Expand Up @@ -190,7 +190,7 @@ def c(foo=42):
for n, span in enumerate(self.spans):
assert span.get_tag(replay.DEBUG_INFO_TAG) == "true"

exc_id = span.get_tag("_dd.debug.error.exception_id")
exc_id = span.get_tag(replay.EXCEPTION_ID_TAG)

info = {k: v for k, v in enumerate(stacks[n], start=1)}

Expand All @@ -215,8 +215,8 @@ def c(foo=42):
assert any(str(s.exc_id) == exc_id for s in snapshots.values())

# assert number of unique exc_ids based on python version
exc_ids = set(span.get_tag("_dd.debug.error.exception_id") for span in self.spans)
assert len(exc_ids) == number_of_exc_ids
exc_ids = set(span.get_tag(replay.EXCEPTION_ID_TAG) for span in self.spans)
assert None not in exc_ids and len(exc_ids) == number_of_exc_ids

# invoke again (should be in less than 1 sec)
with with_rate_limiter(rate_limiter):
Expand Down

0 comments on commit 848fe2b

Please sign in to comment.