bookwyrm-social / bookwyrm

Social reading and reviewing, decentralized with ActivityPub
http://joinbookwyrm.com/
Other
2.17k stars 255 forks source link

Test for inefficient queries #3376

Open mouse-reeve opened 3 weeks ago

mouse-reeve commented 3 weeks ago

Is your feature request related to a problem? Please describe. I’m running into long running database queries that cause worker timeouts when deploying code on b.s. The queries that end up being problematic aren’t obvious to me, and don’t cause problems at a smaller scale so they don’t show up in basic tests.

Describe the solution you'd like If possible, I’d like to check the query time in the Django tests. This would probably require creating a pre populated test dataset, which would cause issues for other tests that assume the state of the database. I also don’t know if this would work very well? But right now I keep breaking production whenever I do a release and that isn’t a great situation

hughrun commented 3 weeks ago

This would probably require creating a pre populated test dataset, which would cause issues for other tests that assume the state of the database.

I think this is a good idea that might help streamline tests, and if it breaks some existing tests they should be re-written. Though I guess this might take a while. Would we load data in with a fixture?