Skip to content

Clean TearDown failure behavior#1870

Merged
kevin-montrose merged 2 commits into
mainfrom
users/kmontrose/testTeardownCleanup
Jun 11, 2026
Merged

Clean TearDown failure behavior#1870
kevin-montrose merged 2 commits into
mainfrom
users/kmontrose/testTeardownCleanup

Conversation

@kevin-montrose

Copy link
Copy Markdown
Contributor

In TestUtils.OnTearDown we check for LightEpoch leaks, and fail if any occurred.

This is a good sanity check, but can make it harder to see the cause of a real test failure.

Additionally, if Tsavorite.core.LightEpoch epochs are leaked, we will not cleanup any leaked Garnet.client.LightEpochs.

PR changes TestUtils.OnTearDown to:

  • always log leaked epochs
  • always reset both kinds of LightEpoch if they are leaked
  • only Assert.Fail(...) on a leaked epoch if the test would pass otherwise

…this makes it easier to see the real cause of a failing test
Copilot AI review requested due to automatic review settings June 11, 2026 19:36

Copilot AI left a comment

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comment thread test/standalone/Garnet.test/TestUtils.cs Outdated
Comment thread test/standalone/Garnet.test/TestUtils.cs
Comment thread test/standalone/Garnet.test/TestUtils.cs

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@kevin-montrose kevin-montrose merged commit 6520b93 into main Jun 11, 2026
284 of 286 checks passed
@kevin-montrose kevin-montrose deleted the users/kmontrose/testTeardownCleanup branch June 11, 2026 21:00
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.

3 participants