Skip to content

Commit

Permalink
mutator: fix resource leakage (#123)
Browse files Browse the repository at this point in the history
There was a resource leakage since we the external management of timeout. Gremlins killed the test process, but not the child processes that remained hanging forever.
  • Loading branch information
k3rn31 committed Aug 12, 2022
1 parent 8df0e90 commit bc44989
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/mutator/mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ func (mu *Mutator) getTestArgs() []string {
if mu.buildTags != "" {
args = append(args, "-tags", mu.buildTags)
}
args = append(args, "-timeout", (1*time.Second + mu.testExecutionTime).String())
args = append(args, "./...")

return args
Expand Down
2 changes: 1 addition & 1 deletion pkg/mutator/mutator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func TestMutatorRun(t *testing.T) {

_ = mut.Run(context.Background())

want := "go test -tags tag1 tag2 ./..."
want := "go test -tags tag1 tag2 -timeout 21s ./..."
got := fmt.Sprintf("go %v", strings.Join(holder.args, " "))

if !cmp.Equal(got, want) {
Expand Down

0 comments on commit bc44989

Please sign in to comment.