improvement to randomly failing test