Skip to content

Commit

Permalink
Fix more test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
odeke-em committed Dec 29, 2024
1 parent 7f0f9ba commit 9a9fdf0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
4 changes: 2 additions & 2 deletions tests/system/test_observability_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def test_propagation(enable_extended_tracing):
_ = val

from_global_spans = global_trace_exporter.get_finished_spans()
from_inject_spans = inject_trace_exporter.get_finished_spans()
target_spans = inject_trace_exporter.get_finished_spans()
from_inject_spans = sorted(target_spans, key=lambda v1: v1.start_time)
assert (
len(from_global_spans) == 0
) # "Expecting no spans from the global trace exporter"
Expand All @@ -111,7 +112,6 @@ def test_propagation(enable_extended_tracing):
wantNames = [
"CloudSpanner.CreateSession",
"CloudSpanner.Snapshot.execute_streaming_sql",
"CloudSpanner.Database.snapshot",
]
assert gotNames == wantNames

Expand Down
19 changes: 1 addition & 18 deletions tests/system/test_session_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,24 +463,7 @@ def test_batch_insert_then_read(sessions_database, ot_exporter):
span=span_list[3],
)

assert_span_attributes(
ot_exporter,
"CloudSpanner.GetSession",
attributes=_make_attributes(db_name, session_found=True),
span=span_list[4],
)
assert_span_attributes(
ot_exporter,
"CloudSpanner.Snapshot.read",
attributes=_make_attributes(db_name, columns=sd.COLUMNS, table_id=sd.TABLE),
span=span_list[5],
)
assert_span_attributes(
ot_exporter,
"CloudSpanner.Database.snapshot",
attributes=_make_attributes(db_name, multi_use=False),
span=span_list[6],
)
assert len(span_list) == 4


def test_batch_insert_then_read_string_array_of_string(sessions_database, not_postgres):
Expand Down

0 comments on commit 9a9fdf0

Please sign in to comment.