+ Start a Discussion
Abhijeet Purohit01Abhijeet Purohit01 

Problem in Production

  I am getting error message while validating in PRODUCTION. 

 Following are the steps 


Created the Outbound ChangeSet in sandbox and uploaded it into Production environment. I have included three things in the ChangeSet: Apex class, Visualforce Page, Custom Field. The TestClass coverage is 100 percent.


 Uploading the ChangeSet into the Production: It said successfully uploaded.


 In Production environment: I clicked Name|Setup|Deploy|Inbound ChangeSet

   selected the required Change Set name and clicked Validate.


 The validation failed and there were 2 errors which are not related to the 3 things which I have uploaded in the Outbound     ChangeSet. The error is in some other TestClass in the Sandbox environment, which I have not even used. 

 Is it possible to get an error message in some other TestClass which I have not at all used?

 Help me! Am new to salesforce.com development. 



Is that TestClass in your production env already? Or has it never been migrated?


Did you by chance add the test class to your change set, then remove it later?


If you want, you can send me a private message with your production org username and also the change set name.  I can take a look for you.  




It is definitely possible.  All of the unit tests are run to ensure that you didn't introduce any regression issues (kind of the point of having them).  There are many different things that could be causing this.


Here are some ideas:

1. See if the same error occurs in the test class in your sandbox (hopefully you have a full copy, because the test could be dependent on actual data).


2. See if the test failure occurs in the class in production outside of your deployment executing it, by running it by itself in the class listing section.


3. There could be something like a validation rule that was introduced, directly in production, that would cause a unit test to fail.


4. Prior to API version 24 unit tests had access to actual data by default, so the tests could be relying on data that has since changed or been deleted.


5. I believe that the unit tests that are run during the deploy are run in parallel (just like you would see from the Apex Test Execution screen; NOT the Apex class listing page).  If some of the tests are prior to API version 24 and they depend on data there could be synchronization issues.


If the error message contains a record ID in it because the test is dependent on actual data, you could paste that ID into the URL to get more information about it.


Basically, there is *a lot* that can could happen, and even though your code may have nothing to do with it and the tests might be failing prior to your deployment, you still won't be able to deploy.