@@ -103,17 +103,25 @@ def test_batch_span_processor(self):
103
103
my_exporter = MySpanExporter (destination = spans_names_list )
104
104
span_processor = export .BatchExportSpanProcessor (my_exporter )
105
105
106
- span_names = ["xxx" , "bar" , "foo" ]
106
+ span_names0 = ["xxx" , "bar" , "foo" ]
107
+ span_names1 = ["yyy" , "baz" , "fox" ]
107
108
108
- for name in span_names :
109
+ for name in span_names0 :
109
110
_create_start_and_end_span (name , span_processor )
110
111
111
112
span_processor .force_flush ()
112
- self .assertListEqual (span_names , spans_names_list )
113
+ self .assertListEqual (span_names0 , spans_names_list )
114
+
115
+ # create some more spans to check that span processor still works
116
+ for name in span_names1 :
117
+ _create_start_and_end_span (name , span_processor )
113
118
114
119
span_processor .shutdown ()
115
120
self .assertTrue (my_exporter .is_shutdown )
116
121
122
+ # check that processor is flushed after shutdown()
123
+ self .assertListEqual (span_names0 + span_names1 , spans_names_list )
124
+
117
125
def test_batch_span_processor_lossless (self ):
118
126
"""Test that no spans are lost when sending max_queue_size spans"""
119
127
spans_names_list = []
0 commit comments