Skip to content

Commit

Permalink
test: fix a data race in the test
Browse files Browse the repository at this point in the history
Don't share resource Metadata() between watch goroutine and tests.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
smira committed Nov 5, 2024
1 parent 3c04d64 commit 5eca531
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/state/conformance/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ func (suite *StateSuite) testWatchKindWithBookmarks(useAggregated bool) {
initial, err := suite.State.List(ctx, res.Metadata())
suite.Require().NoError(err)

suite.Require().NoError(watchAggregateAdapter(ctx, useAggregated, suite.State, res.Metadata(), ch, state.WithBootstrapContents(true)))
suite.Require().NoError(watchAggregateAdapter(ctx, useAggregated, suite.State, res.Metadata().Copy(), ch, state.WithBootstrapContents(true)))

suite.Require().NoError(suite.State.Update(ctx, res))
suite.Require().NoError(suite.State.Update(ctx, res))
Expand Down

0 comments on commit 5eca531

Please sign in to comment.