Skip to content

fix(tsi1/partition/test): fix data race in test code#25298

Merged
devanbenz merged 5 commits into1.11from
db-packport-24613-1.11
Sep 10, 2024
Merged

fix(tsi1/partition/test): fix data race in test code#25298
devanbenz merged 5 commits into1.11from
db-packport-24613-1.11

Conversation

@devanbenz
Copy link
Copy Markdown

Closes #24041

Describe your proposed changes here.

  • I've read the contributing section of the project README.
  • Signed CLA (if not already signed).

@devanbenz devanbenz changed the title chore(edge): backport #24613 to 1.11 fix(tsi1/partition/test): fix data race in test code Sep 9, 2024
Copy link
Copy Markdown
Contributor

@davidby-influx davidby-influx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check error returns on test cleanup


p := MustOpenPartition(sfile.SeriesFile)
defer func() {
t.Cleanup(func() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use this pattern in more of the calls to t.Cleanup?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Sounds good I'll go ahead and adjust

t.Cleanup(func() { sfile.Close() })

p := MustOpenPartition(sfile.SeriesFile)
t.Cleanup(func() { p.Close() })
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dislike the t.Cleanup does not check error returns. If the file or partition fails to close, that seems like an important failure in the test.

@devanbenz
Copy link
Copy Markdown
Author

@davidby-influx I modified the test cleanups to include error handling. I'll go ahead and modify #25288 to include those changes as well 👍

Copy link
Copy Markdown
Contributor

@davidby-influx davidby-influx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@devanbenz devanbenz merged commit ee51e5c into 1.11 Sep 10, 2024
@devanbenz devanbenz deleted the db-packport-24613-1.11 branch September 10, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

data race between test and product code in partition compaction [Port to 1.11 branch]

3 participants