mozilla/kitsune — pull request #674 by willkg (2012-06-21 20:54:28+00:00)
Title: [bug 765207] Fix update_question_vote_chunk

This task would do some ES index updating. The problem is when ES was
down, it'd send a flurry of emails to us plus it wouldn't update
the index.

This fixes that. If ES is down, it'll toss all the questions that
need to be updated into an index_task which retries when it fails.
Now we won't get more emails and the question data won't get
stale.

This is hard to test. Basically, I tweaked the code to raise ESTimeoutError, ran celeryd, and kicked off the cron job. Then verified that index_task items were kicked off. Then I removed the ESTimeoutError and hard-coded the cron job to create a single chunk with a bunch of question ids in it. Then I ran celeryd, kicked off the cron job and verified that it updated the index when everything was fine.

Could do that in a test, but since it generates a bunch of tasks, I wasn't wildly excited about it. I think we'd have to tweak the API for things to make it more testable.

r?