You need to sign in to do that
Don't have an account?
Jonathan Spink
Are you getting random Apex Test failures?
We have been getting Apex Test failures which have little connection to recent development. Sometimes they go away without any direct intervention. Also, it's often only one sandbox that complains.
I have managed to resolve one and the cause was records being returned from a SELECT statement in a different order from usual. So it seems that if you don't use 'ORDER BY' you can't rely on the order of the records being returned.
I have managed to resolve one and the cause was records being returned from a SELECT statement in a different order from usual. So it seems that if you don't use 'ORDER BY' you can't rely on the order of the records being returned.
If you are using SeeAllData=true in test class then the test class will run based on the data present in the sandbox So it way fail based on the data in the sandbox if it is not satisfying any condition.
And also you mentioned about select statement . Yes the Select statment may not return the same result in order always. You have to use Order by class for sorting of the result in an order.
If this solution helps, Please mark it as best answer.
Thanks,