Tania Petsouka
Tania Petsouka

Reputation: 1424

Laravel - DatabaseTransactions - Lock wait timeout exceeded

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

Upvotes: 1

Views: 1668

Answers (1)

Tania Petsouka
Tania Petsouka

Reputation: 1424

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

Thus, a transaction was not closed.

Issue solved.

Upvotes: 5

Related Questions