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
Jerry LaiJerry Lai 

Test Class Fails in production

Hi, has anyone faced similar issue like mine before? What happened is that a few days ago I tried to deploy something new from sandbox... and it failed because a few classes in the production failed its test....but the things I have had these classes in production for at least 2 years...and I even succesfully deployed something on the 20th of april 2015....and now those classes failed all of a sudden...the weird thing is I have the same classes in sandbox (obviously) and they pass the tests fine....so I yeah I am just baffaled as to why would something like this happen...why is it happening...
Vi$hVi$h
Hi Jerry,

Is SeeAllData=true in these test classes ? If yes, then this might be one of the reasons for the failure.

Thanks,
Vishal
Jerry LaiJerry Lai

nop, just a simple @isTest
Vi$hVi$h
Do these test classes fail, only while deploying or do they fail evn when you run them indepndently in production ?
Jerry LaiJerry Lai
In production it fails both indepently or deployment. in sandbox it works fine