Friday, October 27, 2023

How to fix deadlocks with tests?

I'm experiencing deadlocks in my production application occasionally. I'm
using MySQL. Some of these deadlocks are due to insufficient indexing,
and I'd like to fix this with some test-driven development.

How can I write tests that exercise the application concurrently, and
could be used to replicate the deadlocks and then fix them? I use
pytest-django and I use MySQL in my tests; there's a lot of raw SQL and
even some views and stored procedures (😱) in this application and some
of those may be culprits too of course.

I suppose my main question is "how to test bugs that occur due to
concurrency?"

-Josh

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/874jicca6t.fsf%40jgardner.tech.

No comments:

Post a Comment