The standard test class Milestone1_Email_Handler_Tst is causing problems when I attempt to deploy new code to our production system.

System.AssertException: Assertion Failed 
Stack Trace: Class.Milestone1_Email_Handler_Tst.testEmailWithAttachments: line 104, column 1

System.AssertException: Assertion Failed 
Stack Trace: Class.Milestone1_Email_Handler_Tst.testNoAliasWithDefaultMilestoneAlias: line 310, column 1

I've tried resolving the code errors but cannot seem to do so due to this same error. I've also attempted just deleting it to re-add it at a later time.

I cannot do either of these things as it runs the test as part of the deployment process and fails the whole process.

How can I make changes, or remove a malfunctioning test class in production?

  • 1
    Did you try commenting out the entire class (all but first and last lines), then deploying that file with your changes?
    – sfdcfox
    Mar 20, 2015 at 19:23
  • This might help. salesforce.stackexchange.com/questions/23229/…
    – San
    Mar 20, 2015 at 19:25
  • @San I had already seen that, and I'd like to stick to Force.com IDE, or just Salesforce if at all possible. While I'm not opposed to command line, I just do not have the time nor resources at the moment. Mar 20, 2015 at 19:33
  • @sfdcfox Just did that now. Thanks for the suggestion. Now if only I knew why I was getting this error. Mar 20, 2015 at 19:38

1 Answer 1


There is a system.asset statement somewhere in your testclass that is failing. Meaning your expected and incoming test data is not matching. Debug it in Sandbox and find why there is a mismatch and you can easily change your test data to fix it.

Since i see there is a couple of assertion exceptions I feel this should be the ideal way to fix a test class issue.

  • I understood that much, but knowing what the expected data is, and why it's not getting that is beyond my time frame right now. Mar 20, 2015 at 19:40
  • Comment only the assert statements rerun; I mean comment the assert statements in the sandbox and deploy to production. So your production will consider the updated testclass and it should not fail. Hopefully your test coverage stays enough though.
    – Jaguar
    Mar 20, 2015 at 19:43
  • We are seeing a case where when we deploy it seems to run the "old" test class, can you think of any reason this would be happening?
    – Joelio
    Feb 20, 2020 at 0:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .