mercredi 30 mars 2016

1205 Lock wait timeout exceeded while unit testing with database transactions

I am doing some unit testing using phpunit. When I run the tests it hangs fora while, then I get an error:

SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction (SQL: update booking_product set klarna_invoiceId = 7777, klarna_product_status = 3, updated_at = 2016-03-30 18:43:43 where booking_id = 8 and product_id = 1)

If I don't use database transactions I don't have this problem. Some of the tests are working on the same database record.

I'm sure I'm doing sometihng wrong, how do I resolve this issue?

Aucun commentaire:

Enregistrer un commentaire