[SalesForce] How to tests fail in production

This question is connected to my previous question here:
User with read only profile updates records

We have a test case that started failing recently. It is also failing in production. As far as I understand, winter release cannot be the reason, because SF team runs all tests of everyone , theey make sure that all tests pass before making a new release. So, how can tests fail in production ?

Best Answer

While Salesforce does run something called the hammer to ensure a release doesn't break functionalities, that doesn't guarantee that your test will never break in production. This feature doesn't actually care whether the test failed or not, just that if it passed it doesn't fail after the new release (since lots of customers have failing tests in their org).

There are tons of reasons a test can fail in production, you'll need to review the specific test failures to find the cause. That being said, common ones are the addition of a new validation rule that a test method isn't complying with, or a test that references data in the production org that has been modified or deleted.

Related Topic