Fix for JENKINS-23293, refactored isIdle method