Details
Description
Our Sonar instance is coupled with a MySQL DB. When JUnit tests take too much time (in our case more than 6 minutes) the MySQL connection seems to be closed. then Sonar analysis fails with:
...
[INFO] [cobertura:cobertura {execution: default-cli}]
[INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Cobertura: Loaded information on 51 classes.
Report time: 6623ms
[INFO] Cobertura Report generation was successful.
[INFO] Execute org.codehaus.mojo:cobertura-maven-plugin:2.5:cobertura done: 403111 ms
[INFO] Execute maven plugin cobertura-maven-plugin done: 403111 ms
[INFO] Initializer CoberturaMavenInitializer...
[INFO] Initializer CoberturaMavenInitializer done: 2 ms
[INFO] Sensor JavaSourceImporter...
[WARN] SQL Error: 0, SQLState: 08S01
[ERROR] Communications link failure
The last packet successfully received from the server was 403 647 milliseconds ago. The last packet sent successfully to the server was 12 milliseconds ago.
[ERROR] Could not toggle autocommit
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 403 652 milliseconds ago. The last packet sent successfully to the server was 17 milliseconds ago.
...
Maybe we could solve the problem by removing the timeout (we are investigating). But I feel Sonar could be improved by not keeping an open connection during long operations like JUnit/cobertura/cpd.
This issue is in favor of a 2 stage analysis (see SONAR-2119).
We are facing the same issue with our setup and are just not able to get rid of this issue, the time taken to execute our tests is close to 90 minutes and once this is completed, the communication failure occurs. We tried to solve this by changing the sonar.jdbc.* parameters as well as the MYSQL Database configurations but just not able to fix this issue.
Any help on this will be much appreciated