Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testserver: expose NoFileCleanup option to allow retention of files after Stop #172

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

janmejay
Copy link

Retaining files after Stop can help debug some test-failures because
one can start the server back up (off the store-dir left behind after
failure). Looking at the data the failing test left behind can help
hypothesize better.

… after `Stop`

Retaining files after `Stop` can help debug some test-failures because
 one can start the server back up (off the store-dir left behind after
 failure). Looking at the data the failing test left behind can help
 hypothesize better.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

thanks for your contribution!

@@ -234,6 +234,12 @@ func TestRunServer(t *testing.T) {
)
},
},
{
name: "No File Cleanup",
instantiation: func(t *testing.T) (*sql.DB, func()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is there any way for this test to assert that the directory still exists at the end?

Copy link
Author

Choose a reason for hiding this comment

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

Added a dedicated test TestBaseDirIsPreservedWhenNoFileCleanupRequested (but also had to add some additional machinery to power it).

…leCleanup`

`BasedirOverride` allows user to set testserver base-dir (as opposed to
 using a random-dir generated by testserver lib. This helps test
 `NoFileCleanup` better as preserved store-dir's state can now be asserted
 upon after original testserver's teardown.
@janmejay
Copy link
Author

@rafiss does this look alright?

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