|
7 | 7 | from sentry_sdk.integrations.celery import _update_celery_task_headers
|
8 | 8 | import sentry_sdk
|
9 | 9 | from sentry_sdk.tracing_utils import Baggage
|
| 10 | +from tests.conftest import SortedBaggage |
10 | 11 |
|
11 | 12 |
|
12 | 13 | BAGGAGE_VALUE = (
|
@@ -83,10 +84,11 @@ def test_span_with_transaction(sentry_init):
|
83 | 84 |
|
84 | 85 | assert outgoing_headers["sentry-trace"] == span.to_traceparent()
|
85 | 86 | assert outgoing_headers["headers"]["sentry-trace"] == span.to_traceparent()
|
86 |
| - assert outgoing_headers["baggage"] == transaction.get_baggage().serialize() |
87 |
| - assert ( |
88 |
| - outgoing_headers["headers"]["baggage"] |
89 |
| - == transaction.get_baggage().serialize() |
| 87 | + assert outgoing_headers["baggage"] == SortedBaggage( |
| 88 | + transaction.get_baggage().serialize() |
| 89 | + ) |
| 90 | + assert outgoing_headers["headers"]["baggage"] == SortedBaggage( |
| 91 | + transaction.get_baggage().serialize() |
90 | 92 | )
|
91 | 93 |
|
92 | 94 |
|
@@ -117,11 +119,11 @@ def test_span_with_transaction_custom_headers(sentry_init):
|
117 | 119 | if x is not None and x != ""
|
118 | 120 | ]
|
119 | 121 | )
|
120 |
| - assert outgoing_headers["baggage"] == combined_baggage.serialize( |
121 |
| - include_third_party=True |
| 122 | + assert outgoing_headers["baggage"] == SortedBaggage( |
| 123 | + combined_baggage.serialize(include_third_party=True) |
122 | 124 | )
|
123 |
| - assert outgoing_headers["headers"]["baggage"] == combined_baggage.serialize( |
124 |
| - include_third_party=True |
| 125 | + assert outgoing_headers["headers"]["baggage"] == SortedBaggage( |
| 126 | + combined_baggage.serialize(include_third_party=True) |
125 | 127 | )
|
126 | 128 |
|
127 | 129 |
|
|
0 commit comments