File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -318,18 +318,23 @@ func TestConnectAndWriteIntegrationX509Auth(t *testing.T) {
318318 for _ , tt := range tests {
319319 t .Run (tt .name , func (t * testing.T ) {
320320 // validate config
321- require .NoError (t , tt .plugin .Init ())
322-
323- // connect
324- err = tt .plugin .Connect ()
325- tt .connErrFunc (t , err )
321+ err := tt .plugin .Init ()
322+ require .NoError (t , err )
326323
327324 if err == nil {
328- // insert mock metrics
329- require .NoError (t , tt .plugin .Write (testutil .MockMetrics ()))
325+ // connect
326+ err = tt .plugin .Connect ()
327+ tt .connErrFunc (t , err )
330328
331- // cleanup
332- require .NoError (t , tt .plugin .Close ())
329+ if err == nil {
330+ // insert mock metrics
331+ err = tt .plugin .Write (testutil .MockMetrics ())
332+ require .NoError (t , err )
333+
334+ // cleanup
335+ err = tt .plugin .Close ()
336+ require .NoError (t , err )
337+ }
333338 }
334339 })
335340 }
You can’t perform that action at this time.
0 commit comments