Skip to content

Conversation

miazamrai
Copy link
Contributor

@miazamrai miazamrai commented Jan 23, 2023

Cleanup the database clone in the dispose function. An assertion failure after the clone database created will keep the clone database stay in the system unless we clean it up in the dispose function like the normal database.

@miazamrai miazamrai requested a review from torkins January 23, 2023 17:45
@miazamrai
Copy link
Contributor Author

@torkins Looks like we have to refactor this test because the delete database calls in the dispose function are redundant because the Facts/tests themselves are also deleting the database. So, if the test succeeds the deletion in dispose function will be redundant. So, try/finally or using function should be the right approach.

@miazamrai
Copy link
Contributor Author

miazamrai commented Jan 23, 2023

@torkins Looks like we have to refactor this test because the delete database calls in the dispose function are redundant because the Facts/tests themselves are also deleting the database. So, if the test succeeds the deletion in dispose function will be redundant. So, try/finally or using function should be the right approach.

I guess we are good with this approach now but I will create an issue to refactor this test.

@miazamrai
Copy link
Contributor Author

Issue created to refactor the SDK
https://relationalai.atlassian.net/browse/RAI-9417

@miazamrai
Copy link
Contributor Author

@torkins I have done the changes as you requested. Replied to your comments as well. This DatabaseTest.cs anyways require refactoring so either we close this PR and wait for the refactoring or merge this one for right now to avoid leaking databases until we refactor. I am with the second approach.

@torkins
Copy link
Collaborator

torkins commented Jan 26, 2023

@torkins I have done the changes as you requested. Replied to your comments as well. This DatabaseTest.cs anyways require refactoring so either we close this PR and wait for the refactoring or merge this one for right now to avoid leaking databases until we refactor. I am with the second approach.

approved

@miazamrai miazamrai merged commit 15de251 into main Jan 26, 2023
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.

2 participants