Skip to content

Commit

Permalink
fix(test): disable parallel testing for code that have a race condition
Browse files Browse the repository at this point in the history
This is expected due to the way the test is setup. Rather than make the
test be race-condition-safe, I disable it for this test. The race
condition stems from the testing setup, not from the underlying code.
  • Loading branch information
nobe4 committed Jan 8, 2025
1 parent 97bf1da commit 920158f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/notifications/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,12 @@ func TestSync(t *testing.T) {
expected: Notifications{n0Updated, n1},
},
}

//nolint:paralleltest // Those needs to be run sequentially
// The test reuses variables, so it's easier to just not run in
// parallel.
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
t.Parallel()

got := Sync(test.local, test.remote)

if len(got) != len(test.expected) {
Expand Down

0 comments on commit 920158f

Please sign in to comment.