stop database containers when spock execution ends #2843
Merged
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.
Environment
Liquibase Version: N/A
Liquibase Integration & Version: integration test framework
Liquibase Extension(s) & Version: N/A
Database Vendor & Version: N/A
Operating System Type & Version: N/A
Pull Request Type
Description
The existing integration test framework was configured to stop TestSystem's when the
cleanup:
method was called. Spock internally called this method when it finished executing all of the tests in a class. Thus, when a particular test class was completed, its TestSystem was stopped, which in some cases was premature, since other classes might use the same TestSystem.Instead, the TestSystem's should be stopped when Spock finishes executing all of the tests in all classes.
Steps To Reproduce
Create two test classes, both which use the same TestSystem. Run both (through maven, or through Intellij in the same run configuration), and observe that the first test passes and the second test fails with a message indicating that the container has already been shut down.
Actual Behavior
The second test fails with a message indicating that the container has already been shut down.
Expected/Desired Behavior
The second test succeeds using the same TestSystem and the containers are stopped when all tests finish executing.
Screenshots (if appropriate)
Additional Context
Fast Track PR Acceptance Checklist:
Need Help?
Come chat with us in the Liquibase Forum.