mozilla/kitsune — pull request #379 by willkg (2011-12-15 20:17:00+00:00)
Title: [bug 711191] Fix elasticsearch timeout problem

If elasticsearch (the process) isn't available, then the ESTestCases set
settings.ES_LIVE_INDEXING to True, then go to do some indexing stuff and
throw an exception. Since that happens in setUp of ESTestCase, that means
that tearDown never gets called and therefore teardown_indexes never gets
called and settings.ES_LIVE_INDEXING never gets set back to False and
then a whole bunch of tests run with incremental indexing on. Gah!

This is a mediocre fix where we change the order of setup_indexes so
we only set settings.ES_LIVE_INDEXING to True if indexing works. The
better fix is to mock the setting in the specific tests so we don't
end up in this situation.

I should have named the branch something different, but whatever. It's not technically an elastic problem but rather bad code.

r?