We have a following issue while migrating from an obsolete Ipr (tests) runner to a new one.
The run configuration in question is a JUnit test runner that runs a bunch of tests, say, in one package.
To put it shortly, we have a sertain class bar.Foo that presents in a classpath listed in a builder log:
[17:15:12]: [Step 4/5] Starting run configuration BuilderTest ...
[17:15:12]: [Step 4/5] java
[17:15:12]: [java] Tests runtime classpath: [..
But when we try to get this class (via Class.forName("bar.Foo"), for instance) either in a test or in a javaagent that is provided in a run confuguraion, it is a failure. Note: in a test, it works this way if we use a system class loader and probably will work well with a current one.
My observations showed me two things:
1. A test class that is executed in thiis build is loaded by some foreign class loader.
2. A classpath system property in a test contains some odd and unexpected value:
where the last one is a jar for our own javaagent.As you can see, no trace of our own code, both testing and tested.
Therefore, we fail to apply some pre-test bytecode instrumentations and to scan classes in a classpath, which is required for some of our code.
We sertainly can't procceed without those. Is there any hint how this can be fixed?