function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
rtriggrtrigg 

Is deployment in Spring 15 running under some sort of batch?

After Spring 15 update, when I tried to deploy from sandbox to production, I got errors on two tests (out of 32 total) that have always worked fine. Here's what makes this particularly weird:

- Both tests run with no errors when executed by themselves in Apex Test Execution.
- These are the only two of my tests that have asynchronous (@future) methods.  The calls to those methods are only made if not running under a batch (!system.isBatch()).  When I remove that condition so the future calls are always made, the deployment errors go away.

My hypothesis is that Spring 15 has changed deployment somehow so that tests are run in a batch-like process.  I say "batch-like" because if it was a real batch process, then my future call would break since you can't call future from batch.  And yet, system.isBatch() seems to be returning TRUE during deployment (and presumably FALSE under Apex Test Execution).

Is that even possible?  Is there another explanation?

Thanks,

   - Randy
Vla ChaVla Cha
Hi Randy,

could you please post the error message you are hitting while using system.isBatch method? I've observed recently also some strange behavior related to batch processing during deployments on Spring'15 instances.

Thanks!
Vla