1
votes

We execute unit tests (lots of them) Using the DatabaseTransactions trait and a MySQL database connection.

When executing the full test suite, we get 15 or so of "General error: 1205 Lock wait timeout exceeded;". When executing those tests individually, they all succeed.

Issue comes up mostly when executing sync() method, but not only then.

(tried to increase the wait timeout, no luck).

Any suggestion will be much appreciated.

Posted in laracasts as well: https://laracasts.com/discuss/channels/testing/test-suite-general-error-1205-lock-wait-timeout-exceeded

1
Could you show us an example of a test that sometimes fails? And do you have any deviations from the defaults in your project setup? Things like multiple databases, tests which run parallel etc. - PtrTon

1 Answers

4
votes

It came up that a missing parent::tearDown(); was guilty for this.

Thus, a transaction was not closed.

Issue solved.