Added a test for state change on task poll result.