File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,9 @@ func TestServeMetrics(t *testing.T) {
143143 defer func () {
144144 ctx , cancel := context .WithTimeout (context .Background (), 5 * time .Second )
145145 defer cancel ()
146- server .Shutdown (ctx )
146+ if err := server .Shutdown (ctx ); err != nil {
147+ t .Errorf ("failed to shutdown server: %v" , err )
148+ }
147149 }()
148150
149151 time .Sleep (100 * time .Millisecond )
@@ -175,10 +177,14 @@ func getMetrics(t *testing.T) *Metrics {
175177
176178 t .Cleanup (func () {
177179 if provider != nil {
178- provider .Shutdown (context .Background ())
180+ if err := provider .Shutdown (context .Background ()); err != nil {
181+ t .Errorf ("failed to shutdown provider: %v" , err )
182+ }
179183 }
180184 if exporter != nil {
181- exporter .Shutdown (context .Background ())
185+ if err := exporter .Shutdown (context .Background ()); err != nil {
186+ t .Errorf ("failed to shutdown exporter: %v" , err )
187+ }
182188 }
183189 })
184190
You can’t perform that action at this time.
0 commit comments