File tree 1 file changed +9
-3
lines changed
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) {
143
143
defer func () {
144
144
ctx , cancel := context .WithTimeout (context .Background (), 5 * time .Second )
145
145
defer cancel ()
146
- server .Shutdown (ctx )
146
+ if err := server .Shutdown (ctx ); err != nil {
147
+ t .Errorf ("failed to shutdown server: %v" , err )
148
+ }
147
149
}()
148
150
149
151
time .Sleep (100 * time .Millisecond )
@@ -175,10 +177,14 @@ func getMetrics(t *testing.T) *Metrics {
175
177
176
178
t .Cleanup (func () {
177
179
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
+ }
179
183
}
180
184
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
+ }
182
188
}
183
189
})
184
190
You can’t perform that action at this time.
0 commit comments