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

fixed Too many connections error. #276

Merged
merged 6 commits into from Dec 16, 2018

Conversation

ytetsuro
Copy link
Contributor

@ytetsuro ytetsuro commented Nov 12, 2018

I encountered error following.

A PHP Error was encountered

Severity:    Warning
Message:     mysqli::real_connect(): (08004/1040): Too many connections
Filename:    /vagrant/html/vendor/codeigniter/framework/system/database/drivers/mysqli/mysqli_driver.php
Line Number: 201

ci-phpunit-test is no close database connection, when call Loader::database second argument true.
for that reason encount error when frequent call Loader::database method in test case.

This problem solution is following.

  • create collection class for db connection.
  • collect db connection when call Loader::database second argument is true.
  • close db connection from collected when call CIPHPUnitTestCase::tearDownAfterClass.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 72.757% when pulling ead6b48 on ytetsuro:feat/db-connection-close into e38a140 on kenjis:master.

@kenjis kenjis merged commit 2bd32ec into kenjis:master Dec 16, 2018
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.

None yet

3 participants