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

[11.x] Disconnecting the database connection after testing #49362

Conversation

KentarouTakeda
Copy link
Contributor

fixes #49311

#49327 has been reverted as a breaking change.
I would like to propose the same fix as a major version update.

This fix prevents connections from leaking when testing with a database without having to write workaround code in each test.

@KentarouTakeda
Copy link
Contributor Author

Oh, I created a Pull Request without realizing that it had already been merged. Close this. thank you!

@KentarouTakeda KentarouTakeda deleted the fix/gh-49311-disconnect-after-db-test branch December 13, 2023 12:06
@siketyan
Copy link

IIRC, after 10.x branch which contains the reverted changes is merged to master, the changes will also be reverted in master, right? I think we should keep this open and rebase onto master once the branch is synced with 10.x branch. @KentarouTakeda

@KentarouTakeda KentarouTakeda restored the fix/gh-49311-disconnect-after-db-test branch December 13, 2023 13:01
@KentarouTakeda
Copy link
Contributor Author

@siketyan
That's right, thank you!
After 10.x is merged into master, I will re-open after fixing the commit.

* Disconnection after testing with traits for database testing

* Revert "Disconnection after testing with traits for database testing"

This reverts commit 71c6653.

* Disconnection at teardown

* No need to disconnect for individual traits

* fix: Behavior when run without database

* Avoid changing the behavior before fixing as much as possible.

* Update TestCase.php

---------

Co-authored-by: Taylor Otwell <[email protected]>
@KentarouTakeda KentarouTakeda force-pushed the fix/gh-49311-disconnect-after-db-test branch from 546989a to 5e7fa2e Compare December 13, 2023 15:45
@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If possible, please consider releasing your code as a package so that the community can still take advantage of your contributions!

If you feel absolutely certain that this code corrects a bug in the framework, please "@" mention me in a follow-up comment with further explanation so that GitHub will send me a notification of your response.

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