Getting the error "No active batch." when running any batch
If you are using the Secure Pages module, you have apply the patches provided for that module.

As I am using the Secure Pages module, that fixed my problem.


  Steps to install Secure Pages 7.x-dev
  
  
  Set $conf['https'] = TRUE; in settings.php.
  Apply these two patches:
  
  
  #961508-21: Dual http/https session cookies interfere with drupal_valid_token()
  #471970-13: DrupalWebTestCase->getAbsoluteUrl should use internal browser's base URL