Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(encoding): fix encoding errors when the span started a very long time ago #12368

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tests/tracer/test_encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,22 @@ def test_msgpack_span_property_variations(encoding, span):
assert decode(refencoder.encode_traces([trace])) == decode(encoder.encode()[0])


@allencodings
def test_long_span_start(encoding):
refencoder = REF_MSGPACK_ENCODERS[encoding]()
encoder = MSGPACK_ENCODERS[encoding](1 << 10, 1 << 10)

# Start a span a very long time ago
span = Span(None)
span.start = -62135596700
span.finish()

trace = [span]
encoder.put(trace)
# TODO: Right now this fails with Python int too large to convert to C long
assert decode(refencoder.encode_traces([trace])) == decode(encoder.encode()[0])


class SubString(str):
pass

Expand Down
Loading