Skip to content

Commit

Permalink
Context cancelling should be tied to the test execution (#96)
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
  • Loading branch information
slinkydeveloper authored Feb 22, 2021
1 parent be32f9c commit 712fadf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/environment/magic.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ func (mr *MagicEnvironment) Test(ctx context.Context, t *testing.T, f *feature.F
continue
}
t.Run(s.TestName(), func(t *testing.T) {
ctx, cancelFn := context.WithCancel(ctx)
t.Cleanup(cancelFn)

wg.Add(1)
defer wg.Done()

Expand Down

0 comments on commit 712fadf

Please sign in to comment.