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
verynewbieverynewbie 

Deploying code...

Hi 

 

I have written a trigger in my sandbox .I am trying to deploy that to production along with my test class(100% code coverage)

I got error in validating.My package is saying too many soql queries.

I ran the test class indivually in sandbox ...all methods are passed with 87% code coverage.

When i run the same class in production its giving me error.What might be the reason?any suggestions?

 

Best Answer chosen by Admin (Salesforce Developers) 
verynewbieverynewbie
I figured it out...It was only having 16 soql and rest was some code from managed package.Made some setting changes and it wrked.
weird but finally deployed it and reactivated my package.

All Answers

Rahul_sgRahul_sg
Note down the test class name that is failing in prod.
and run this test class in sandbox and setup debug log.
open the log after you run the test method and check the no of soql queries it should be near 100 ( close to limit)

Now you can remove/comment some code in your test method or split it into 2 test classes. this should help to resolve your issue
verynewbieverynewbie
I figured it out...It was only having 16 soql and rest was some code from managed package.Made some setting changes and it wrked.
weird but finally deployed it and reactivated my package.
This was selected as the best answer