testserver: expose NoFileCleanup option to allow retention of files after Stop#172
Open
janmejay wants to merge 2 commits intocockroachdb:masterfrom
Open
testserver: expose NoFileCleanup option to allow retention of files after Stop#172janmejay wants to merge 2 commits intocockroachdb:masterfrom
NoFileCleanup option to allow retention of files after Stop#172janmejay wants to merge 2 commits intocockroachdb:masterfrom
Conversation
… 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.
Member
rafiss
requested changes
Oct 12, 2023
Contributor
rafiss
left a comment
There was a problem hiding this comment.
thanks for your contribution!
| }, | ||
| { | ||
| name: "No File Cleanup", | ||
| instantiation: func(t *testing.T) (*sql.DB, func()) { |
Contributor
There was a problem hiding this comment.
is there any way for this test to assert that the directory still exists at the end?
Author
There was a problem hiding this comment.
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.
ddb3646 to
ae92af3
Compare
Author
|
@rafiss does this look alright? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Retaining files after
Stopcan help debug some test-failures becauseone 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.