Details
-
Bug
-
Resolution: Done
-
Major
-
5.3.0.Beta1
-
None
Description
alwaysRun=true makes the invocation of that method to happen even if the test that has the method is not in the running group:http://testng.org/javadoc/org/testng/annotations/BeforeMethod.html#alwaysRun()
E.g. if I want to run the "xsite" groups, all the @AfterMethod(alwaysRun=true) from the "functional" groups are also invoked, most likely causing NPEs as the resources from this tests haven't been initialised. So unless used for an abstract test class that would be extended by multiple classes from different groups, I don't see any point in using "alwaysRun" on neither @BeforeMethod nor on @AfterMethod.
This is causing the suite to exit:
[14:53:10][org.infinispan:infinispan-server-core]
[14:53:10][org.infinispan:infinispan-server-core] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[14:53:10][org.infinispan:infinispan-server-core] !!!!!! (testng-MarshallingTest) Exiting because MarshallingTest has NOT shut down all the cache managers it has started !!!!!!!
[14:53:10][org.infinispan:infinispan-server-core] !!!!!! (testng-MarshallingTest) The still-running cacheManager was created here: org.infinispan.server.core.AbstractMarshallingTest.setUp(AbstractMarshallingTest.scala:49) !!!!!!!
[14:53:10][org.infinispan:infinispan-server-core] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
AbstractMarshallingTest.tearDown is always invoked(always=true) so I don't know why this doesn't get cleaned up. Anyway better to use TestUtil.killCacheManager(..) for handling this.
http://ci.infinispan.org/viewLog.html?buildId=1005&buildTypeId=bt2&tab=buildLog#_focus=27336