Unit tests errors when atlas-run on previously built plugin project

Hello.

I have encountered a rather strange problem.

The thing is, when I run atlas-run for the first time it completes successfully - builds my plugin project, downloads everything needed, runs tests etc.

Now, when I shut down the running jira instance and attempt to get it back up again with atlas-run it fails on tests throwing errors like :

java.lang.IllegalStateException: Failed to transform class with name com.mypackage.MyClassNameTest. Reason: cannot find com.mypackage.MyOtherClassName
Caused by: javassist.CannotCompileException: cannot find com.mypackage.MyOtherClassName
Caused by: javassist.NotFoundException: com.mypackage.MyOtherClassName

or

java.lang.NoClassDefFoundError: Lcom/mypackage/MyClassName;
Caused by: java.lang.ClassNotFoundException: com.mypackage.MyClassName;

I’ve tried the most obvious solutions. I tampered with Maven Surefire Plugin configuration to add additional classpath elements, I’ve run mvn -X test to see the classpath (and it looked okay), I’ve tried updating javassist version as I use PowerMockito in some of the tests, and nothing worked.

I have also checked to see if the classes that generate the errors have anything special to them, but there is nothing like that. The compile directories target/classes and target/test-classes also look fine, everything that should be there is there.

What’s also weird is that I have ~68 unit tests written yet when the errors occur only 6 are executed (they all fail) and it’s like the rest doesn’t exist.

My unit tests are mainly written with JUnit5 + Mockito with some exceptions that use PowerMockito + JUnit4. As I’ve mentioned the tests that fail don’t have anything in common as far as I can tell.

Of course running mvn-clean magically fixes everything and tests run successfully that one time.
Also I can run atlas-run -DskipTests to get my jira instance up, and yet still these errors are inconvinient.

Does anybody have any idea how to fix this, or what to investigate to gain some insight into the reason why this is happening ?

Thanks in advance for any input on the topic.
Cheers.

Could you check if you have any Java 9 module-info files in the target directory? They could be introduced by dependencies that you consume. By default, all dependencies are extracted. You can change this setting extractDependencies and the error no longer occurs. You add the parameter to the jira-maven-plugin.

Thank you for your response!

I’ve now confirmed that in my target directory there is nothing containing the string “module-info”. I have also set the extractDependencies variable to false and the error still occurs.

But there is a new piece of information. In the meantime I’ve set up a Vagrantfile to work with JIRA in a VM. This VM is set up based on hashicorp/bionic64 box, which is basically Ubuntu with some extra packages installed as far as I can tell. When I run JIRA via Vagrant ssh connection there is no problem with bringing JIRA down and up again. That leads me to believe there is either something wrong with my local environment or maybe atlas commands behave somewhat differently on Windows 10 (my main operating system).

What do you think ?

Hi @MaciejWikira,

oh, you’re using Windows :smiley:

Some people have reported problems when running Atlassian SDK 8.0.16 on Windows. I don’t have any, but possibly because I’m aware of issues and being able to fix them myself (I’m running a custom Atlassian SDK which contains a few bugfixes). It’s difficult to say if you really have a broken environment, or if this is an SDK problem.

1 Like