You need to sign in to do that
Don't have an account?
Moran Assa
System.Exception: Too many SOQL queries: 101 in test class!
We have a test class with (SeeAllData=true),
The class recently started failing due to 'Too many SOQL queries: 101 in test class'.
We understand the problem in the code but now we don't seem to be able to update the test class on the live organization
(In a change set from the sandbox) because the test fails on deploy.
Any way to solve this issue?
Thanks
All Answers
Only solutions to this can be:
1. See where it is hitting so many SOQLs through debug logs and optimise code for same so re-deploy after refactoring
2. Follow best proctices for deployments for deployments and bulk testings. So, get a fresh UAT and work in it to see why it happening.
Thanks for your reply.
We know where in the code the problem occurs. we can't do anything about that though, because when we try to deploy a fixed version of the test class, the deploy process fails (for too many SOQL queries).
Is there a way we can disable a test on the live organization, just so we can upload a fixed version of the test?
The problem is in a test class (that runs automatically on deploy), is there a way to disable that class?
Thanks
If you still hit this error other hacky way to bypss triggers from test class run is use of static variables, in your test class define a static variable, set it to true and then in your triggers add a line at the top that will check this static flag and bypass them if the static variable is set to true.
Note - Only bypass the triggers you dont need and are not trying to cover with this method.
Thanks for the help,
Got it working now