Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit 73f6145

Browse files
1 parent e5993ff commit 73f6145

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

tests/system/_sample_data.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,20 @@ def _assert_timestamp(value, nano_value):
8888
if time_diff < 1:
8989
if isinstance(value, datetime_helpers.DatetimeWithNanoseconds):
9090
expected_ns = value.nanosecond
91-
found_ns = nano_value.nanosecond if hasattr(nano_value, 'nanosecond') else nano_value.microsecond * 1000
91+
found_ns = (
92+
nano_value.nanosecond
93+
if hasattr(nano_value, "nanosecond")
94+
else nano_value.microsecond * 1000
95+
)
9296
# Allow up to 1ms difference for timestamp precision issues
9397
ns_diff = abs(expected_ns - found_ns)
9498
if ns_diff > 1_000_000:
9599
print(f"DEBUG: Timestamp comparison failed:")
96100
print(f" Expected: {value} (nanosecond: {expected_ns})")
97101
print(f" Found: {nano_value} (nanosecond: {found_ns})")
98-
print(f" Difference: {ns_diff} nanoseconds ({ns_diff / 1_000_000:.3f} ms)")
102+
print(
103+
f" Difference: {ns_diff} nanoseconds ({ns_diff / 1_000_000:.3f} ms)"
104+
)
99105
assert ns_diff <= 1_000_000, f"Nanosecond diff {ns_diff} > 1ms"
100106
else:
101107
# Allow up to 1 microsecond difference for timestamp precision issues
@@ -107,6 +113,7 @@ def _assert_timestamp(value, nano_value):
107113
print(f" Difference: {us_diff} microseconds")
108114
assert us_diff <= 1, f"Microsecond diff {us_diff} > 1"
109115

116+
110117
def _check_rows_data(rows_data, expected=ROW_DATA, recurse_into_lists=True):
111118
assert len(rows_data) == len(expected)
112119

tests/system/test_session_api.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -873,20 +873,26 @@ def _build_request_id():
873873
# between multiplexed and non-multiplexed modes
874874
actual_span_count = len(span_list)
875875
expected_span_count = len(expected_span_properties)
876-
876+
877877
# Allow for flexibility in span count due to session management
878878
if actual_span_count != expected_span_count:
879-
print(f"DEBUG: Span count mismatch - Expected: {expected_span_count}, Got: {actual_span_count}")
880-
print(f"DEBUG: Expected span names: {[prop['name'] for prop in expected_span_properties]}")
879+
print(
880+
f"DEBUG: Span count mismatch - Expected: {expected_span_count}, Got: {actual_span_count}"
881+
)
882+
print(
883+
f"DEBUG: Expected span names: {[prop['name'] for prop in expected_span_properties]}"
884+
)
881885
print(f"DEBUG: Actual span names: {[span.name for span in span_list]}")
882-
886+
883887
# For now, we'll verify the essential spans are present rather than exact count
884888
actual_span_names = [span.name for span in span_list]
885889
expected_span_names = [prop["name"] for prop in expected_span_properties]
886-
890+
887891
# Check that all expected span types are present
888892
for expected_name in expected_span_names:
889-
assert expected_name in actual_span_names, f"Expected span '{expected_name}' not found in actual spans: {actual_span_names}"
893+
assert (
894+
expected_name in actual_span_names
895+
), f"Expected span '{expected_name}' not found in actual spans: {actual_span_names}"
890896
else:
891897
# If counts match, verify each span in order
892898
for i, expected in enumerate(expected_span_properties):

0 commit comments

Comments
 (0)