Skip to content

Commit

Permalink
app/forkjoin: fix race in test (#2010)
Browse files Browse the repository at this point in the history
Fixes race in `TestPanic` test.

category: misc
ticket: none
  • Loading branch information
corverroos authored and LukeHackett12 committed Apr 11, 2023
1 parent 3ee9463 commit 46c6bb4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/forkjoin/forkjoin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,9 @@ func TestForkJoin(t *testing.T) {
func TestPanic(t *testing.T) {
defer goleak.VerifyNone(t)

fork, join, cancel := forkjoin.New[int, int](context.Background(), nil)
defer cancel()

fork, join, cancel := forkjoin.New[int, int](context.Background(), nil, forkjoin.WithWaitOnCancel())
join()
cancel()

// Calling fork after join panics
require.Panics(t, func() {
Expand Down

0 comments on commit 46c6bb4

Please sign in to comment.