Increase MySQL max_connections for unit tests

We've seen that sometimes our unit tests create a lot of mysql
connections simultaneously[1][2] and cause the tests to fail. Increase
the max_connections limit from 151 to 1024, which is what devstack
uses[3].

[1] http://logs.openstack.org/43/536543/9/check/openstack-tox-py35/0729ea7/job-output.txt.gz#_2018-01-30_19_36_38_136523
[2] http://logs.openstack.org/23/524423/44/gate/openstack-tox-py35/0f8083f/job-output.txt.gz#_2018-01-28_21_11_52_855308
[3] http://git.openstack.org/cgit/openstack-dev/devstack/tree/lib/databases/mysql?id=640150683d137a9a10dfe833e7a34b7ea6cdfb1a#n99

Change-Id: Ic9f9ca696af1876eb5a728356a98d70352ef9bc3
Related-bug: #1746016
This commit is contained in:
Colleen Murphy 2018-01-30 23:45:55 +01:00
parent ff77bb80fa
commit 45e8b6e0ec
1 changed files with 4 additions and 0 deletions

View File

@ -26,6 +26,10 @@ sudo -H mysql -u root -p$DB_ROOT_PW -h localhost -e "
GRANT ALL PRIVILEGES ON *.*
TO '$DB_USER'@'%' identified by '$DB_PW' WITH GRANT OPTION;"
# Bump the max_connections limit
sudo -H mysql -u root -p$DB_ROOT_PW -h localhost -e "
SET GLOBAL max_connections = 1024;"
# Now create our database.
mysql -u $DB_USER -p$DB_PW -h 127.0.0.1 -e "
SET default_storage_engine=MYISAM;