On Tue, 23 Feb 2010, Victor Engmark wrote:
> I'm having some trouble running unit tests that modify the database

If the DB gets modified, then please put these tests into the regression
test suite.

> Exception _mysql_exceptions.ProgrammingError: (2014, "Commands out of
> sync; you can't run this command now") in <bound method Cursor.__del__
> of <MySQLdb.cursors.Cursor object at 0x8f1df8c>> ignored

We saw errors like that in situations when a connection died and was not
properly awaken when a query was launched.  Usually, run_sql() should
take good care of re-opening connections, so if you use only run_sql(),
chances are the connection should be re-established properly.

Do you get this error repetitively every time you run your tests?  Does
it die in the same place?  You can run this via ipython to have more
debugging info (e.g. which query failed, what the variables on the stack
were), or you can simply enable detailed SQL query logging by
un-commenting the log_sql_query() call in dbquery.py.

Best regards
--
Tibor Simko ** CERN Document Server ** <http://cds.cern.ch/>

Reply via email to