Massive unit test vs MySQL

Richard Wesley hawkfish at trustedmedianetworks.com
Thu Sep 4 16:35:17 EDT 2003


I don't know if this is really a Python question of a MySQL question, 
but i am hopen that there is enough overlap that someone can help me ;-)

I have a unit test suite for our server that loads a clean database 
image for many of the tests.  I use

p = os.popen('mysql -u uid -ppassword mydatabase', 'w')
p.write(sql_commands)

to load the database.

While the tests are running, I find that mysql has a growing number of 
"Sleeping" threads in the 'show processlist' table.  Towards the end of 
the test suite, the database loads start to fail with a MySQL error of 
"ERROR 1040: Too many connections".

So my question would be, is there any way to shut down the child process 
so that MySQL notices and cleans up after itself before it runs out of 
threads?

TIA,

-- 

- rmgw

<http://www.trustedmedianetworks.com/>

----------------------------------------------------------------------------
Richard Wesley                                  Trusted Media Networks, Inc.

"If we're not careful, we could have a farce on our hands!" 
     - Tom Stoppard, _On The Razzle_




More information about the Python-list mailing list