Maven + Surefire + Byteman + java.io.tmpdir = Tests failures
aheritier Oct 23, 2012 9:15 AMHi all,
We are using in our project Byteman with our Junit Tests Managed by Maven and its surefire plugin to add some additionnal controls (number of jdbc queries used for ex).
Cleaning up our build I wanted to apply this maven recommandation : http://olamy.blogspot.fr/2012/08/maven-surefire-configuration-for-ci.html
It is to avoid to have all builds using the same /tmp directory thus I wanted to put that in our coporate pom to be sure that it is used by all projects.
Adding this setting broke all our tests using byteman
It is now always failing to connect with an error like this :
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:189)
at org.jboss.byteman.agent.submit.Submit$Comm.<init>(Submit.java:797)
at org.jboss.byteman.agent.submit.Submit.submitRequest(Submit.java:735)
at org.jboss.byteman.agent.submit.Submit.addScripts(Submit.java:574)
at org.jboss.byteman.agent.submit.Submit.addRulesFromFiles(Submit.java:547)
at org.jboss.byteman.contrib.bmunit.BMUnit.loadScriptFile(BMUnit.java:305)
at org.exoplatform.social.core.test.AbstractCoreTest.setUp(AbstractCoreTest.java:60)
at org.exoplatform.social.core.storage.cache.CachedIdentityStorageTestCase.setUp(CachedIdentityStorageTestCase.java:46)
at junit.framework.TestCase.runBare(TestCase.java:132)
at org.exoplatform.component.test.AbstractGateInTest.runBare(AbstractGateInTest.java:87)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
I don't see at all the relation between the system property java.io.tmpdir and byteman.
I looked at your code and saw nothing strange like an hardcoded tmp directory.
Is it something that someone already saw ?
Are there some others users who may try this setting to see if they have the same problem ?
All advices are welcome
Thx
Arnaud