Could you change this to `COMPLETED_STATES`? It's a bit odd to have a set of FINISHED_STATES that includes `FINISHED` and also other things. The terminology here overall could be improved (of the existing code), but absent that, I'd prefer to have it be called `COMPLETED_STATES`.