Skip to content

Commit

Permalink
Move cmd.Process.Kill() to inside t.CleanUp
Browse files Browse the repository at this point in the history
Signed-off-by: James Ryans <james.ryans2012@gmail.com>
  • Loading branch information
james-ryans committed Apr 5, 2024
1 parent 0f2ceb4 commit 992542a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cmd/jaeger/internal/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ const otlpPort = 4317
type E2EStorageIntegration struct {
integration.StorageIntegration
ConfigFile string

binaryProcess *os.Process
}

// e2eInitialize starts the Jaeger-v2 collector with the provided config file,
Expand All @@ -45,7 +43,9 @@ func (s *E2EStorageIntegration) e2eInitialize(t *testing.T) {
Stderr: os.Stderr,

Check warning on line 43 in cmd/jaeger/internal/integration/integration.go

View check run for this annotation

Codecov / codecov/patch

cmd/jaeger/internal/integration/integration.go#L41-L43

Added lines #L41 - L43 were not covered by tests
}
require.NoError(t, cmd.Start())
s.binaryProcess = cmd.Process
t.Cleanup(func() {
require.NoError(t, cmd.Process.Kill())

Check warning on line 47 in cmd/jaeger/internal/integration/integration.go

View check run for this annotation

Codecov / codecov/patch

cmd/jaeger/internal/integration/integration.go#L45-L47

Added lines #L45 - L47 were not covered by tests
})

spanWriter := createSpanWriter(otlpPort)
require.NoError(t, spanWriter.Start())
Expand All @@ -59,6 +59,4 @@ func (s *E2EStorageIntegration) e2eInitialize(t *testing.T) {
func (s *E2EStorageIntegration) e2eCleanUp(t *testing.T) {
require.NoError(t, s.SpanReader.(io.Closer).Close())
require.NoError(t, s.SpanWriter.(io.Closer).Close())

Check warning on line 61 in cmd/jaeger/internal/integration/integration.go

View check run for this annotation

Codecov / codecov/patch

cmd/jaeger/internal/integration/integration.go#L59-L61

Added lines #L59 - L61 were not covered by tests

s.binaryProcess.Kill()
}

0 comments on commit 992542a

Please sign in to comment.