Commits
Anthony Minessale committed f33e9c6edef
FS-2966 I already fixed this in the wait_for_state, so i copied the same fix to wait_for_state_timeout, the lua one needed a similar call to wait for the state to change to avoid a race, both of you should be fixed with this patch