[infinispan-dev] to stop swallowing exceptions in testsuite?

Galder Zamarreño galder at redhat.com
Thu Aug 15 09:54:33 EDT 2013


On Aug 15, 2013, at 12:39 AM, Sanne Grinovero <sanne at infinispan.org> wrote:

> It took me quite some time to figure out about a resource leak in the
> Query testsuite.
> 
> The Search Engine properly warns about unclosed resources, but the
> automated test "cleanup" phase of the Infinispan testing framework
> swallows and ignores any exception happening during a
> CacheManager#close.
> 
> I realize there is a need for a "safe" cleanup but ignoring exceptions
> is very tricky, could we change that to have the test fail at least?

That might be tricky because often cache manager close happens in the @AfterClass phase at which stage you cannot really fail a particular test. Not even if that was done in @AfterMethod you'd get a test failure AFAIK. 

The only time that it can lead to a test failure is when the cache manager is closed within the test itself.

Maybe what we need is some tests that verify that when cache managers are closed, resources are released. These could be subclassed/extended by other modules that add extra resources to their work, and which should be released when cache manager closes.

Cheers,

> 
> Cheers,
> Sanne
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev


--
Galder Zamarreño
galder at redhat.com
twitter.com/galderz

Project Lead, Escalante
http://escalante.io

Engineer, Infinispan
http://infinispan.org




More information about the infinispan-dev mailing list