Fix timeout test by stubbing, not mocking.

The mocked `index_name` call in the indexing test is called by a piece of
logging code, so may or may not be called depending on the environment. It's
not important to the function of the code itself, so we can stub it (no
expectation it will be called) rather than mocking it.