diff --git a/tests/system/test_observability_options.py b/tests/system/test_observability_options.py index 9a006462be..ad535c57cb 100644 --- a/tests/system/test_observability_options.py +++ b/tests/system/test_observability_options.py @@ -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" @@ -111,7 +112,6 @@ def test_propagation(enable_extended_tracing): wantNames = [ "CloudSpanner.CreateSession", "CloudSpanner.Snapshot.execute_streaming_sql", - "CloudSpanner.Database.snapshot", ] assert gotNames == wantNames diff --git a/tests/system/test_session_api.py b/tests/system/test_session_api.py index bcc2b552a8..d2a86c8ddf 100644 --- a/tests/system/test_session_api.py +++ b/tests/system/test_session_api.py @@ -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):