Search code examples
javaspringjunitjmockit

JMockit migration result on slower test


Recently we faced a migration from jmockit 0.99915 to jmockit 1.21 and Java 6 to java 7 ,after made the adaptations related to deprecated api's and other things our test run slower than before the migration.

Before the migration our 1600 Integration test used to run in 5-7 minutes, now they require 15-20 minutes, ¿Does anyone had similar issues?.

Here a few considerations:

  • I know that there is a greater version of jmockit but we need to use this.
  • We have several modules on our application (36) so that could not be a problem if we had only one or two but now our constructions requires several ours to built so we overlap with other constructions on the Continuous integration system we are not allow to do that.
  • We didn't change anything else neither our code or our configurations, just this upgrades: (Java 6 to java 7, Maven 2.2.1 to maven 3.3.9, Jmockit 0.99915 to 1.21)

Our application:

  • Spring based web application using Spring runner to run the test.
  • Junit version 4.10
  • We have an In-memory database to run the test
  • We are using NonStrictExpectations and @Mocked annotations to run our test, some test case's have a parent which extend where the mocked fields are declared
  • Some large test require over 30 mocked objects the smaller ones just one or two.

Solution

  • After ask this question and check the issue related i can confirm that our mainly problem was the use of @Mocked mocks in conjunction with the upgrade, as is said on the issue.