Adding pollForTimeout method and test.