Skip to content

Commit ba3e3c4

Browse files
[chore]: Improve test coverage of expvar extension (#7484)
## Which problem is this PR solving? - Improves Code coverage of `cmd/jaeger/internal/extension/expvar/extension.go` ## Description of the changes - removes nested if which will reduce amount of untested code. ## How was this change tested? - ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: anmol7344 <[email protected]> Signed-off-by: Anmol <[email protected]> Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
1 parent 472aa5a commit ba3e3c4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

cmd/jaeger/internal/extension/expvar/extension.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ func (c *expvarExtension) Start(ctx context.Context, host component.Host) error
6363
}
6464

6565
func (c *expvarExtension) Shutdown(ctx context.Context) error {
66-
if c.server != nil {
67-
if err := c.server.Shutdown(ctx); err != nil {
68-
return fmt.Errorf("error shutting down expvar server: %w", err)
69-
}
70-
c.shutdownWG.Wait()
66+
if c.server == nil {
67+
return nil
7168
}
72-
return nil
69+
70+
err := c.server.Shutdown(ctx)
71+
c.shutdownWG.Wait()
72+
73+
return err
7374
}

0 commit comments

Comments
 (0)