Coming from #28036 (comment), I thought that we were going to fix it there but seems that got merged without it for some reason.
As index sync failures trigger a shutdown request without notifying BaseIndex::BlockUntilSyncedToCurrentChain
in any way, we also need to check whether a shutdown was requested or not inside ‘IndexWaitSynced’.
Otherwise, any error inside the index sync process will hang the test forever.