1

I am encountering a bizarre issue with one of our sandbox orgs.

I modified a LWC in our testing org and I wanted to deploy the changes with a change set to a secondary sandbox org.

For some reason, when deploying the change set, it failed saying an apex class needs recompilation with the message that the method "isRunningTest" from the Test namespace wasn't recognized.

It was weird because the Apex class wasn't used by my LWC. I decided to compile all the apex classes in that org and virtually every class couldn't compile because the Test methods aren't recognized:

enter image description here

I've never encountered a similar issue beforem so I don't really know how to go on from here. I compiled my classes in our testing sandbox org and this doesn't happen.

Any help is appreciated

3
  • 4
    Looks like classic name shadowing. Do you have a class named just Test?
    – Derek F
    Commented Jul 23 at 19:56
  • @DerekF no, we do not have a class named Test. We have the same codebase in both the sandbox orgs and this problem happens only in one of them Commented Jul 23 at 19:59
  • 3
    This is almost certainly name shadowing. Try using the workbench, under the REST Explorer, use /services/data/v58.0/tooling/sobjects/ApexClass/Name/Test, and see if you get a result.
    – sfdcfox
    Commented Jul 23 at 20:38

1 Answer 1

1

It was indeed name shadowing.

An empty class named Test existed on the org. Once deleted, it resolved the issue.

You must log in to answer this question.

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