BINGO!!!!!
 
Was actually the LHS class (but once I narrowed it down to two classes, wasn't 
that hard to figure out).
 
Nicely played sir. I owe you several beverages of your choice. ApacheCon?
 
Justin

________________________________

From: Stephen Connolly [mailto:[EMAIL PROTECTED]
Sent: Thu 9/25/2008 4:09 PM
To: user@mojo.codehaus.org
Subject: Re: [mojo-user] test pass normally, but fail under cobertura


I wonder if you have duplicate classes on your classpath?

It may be that one set of them is resolving in one order while the other set it 
resolving in the other.

Also doesn't Spring do some sort of classloader isolation... 

It's looking like it's probably a problem (unrelated to coverage) that has been 
exposed by running tests with coverage.... now if only you can figure out what 
the problem is!

I'd start be checking if multiple jars in your dependency classpath define the 
class on the RHS of the instanceof expression


2008/9/25 Edelson, Justin <[EMAIL PROTECTED]>


        Good idea. Emma shows the same behavior. I'll try Clover next.
         
        The documentation of the Emma plugin is incorrect. Posted a patch as 
MOJO-1234. Would highly recommend someone apply the patch and do a site-deploy.
         
        Justin
        
         
         

________________________________

        
        From: Stephen Connolly [mailto:[EMAIL PROTECTED]
        
        Sent: Thu 9/25/2008 3:10 PM 

        To: user@mojo.codehaus.org
        Subject: Re: [mojo-user] test pass normally, but fail under cobertura
        

        Any chance you could give it a poke with emma or clover (they've a 30 
day eval license for free)
        
        It might reveal if it's the instrumentation per se that is the problem 
or if it's limited to cobertura
        
        
        2008/9/25 Edelson, Justin <[EMAIL PROTECTED]>
        

                See my other email about the instanceof problem. I don't see 
how this is a concurrency problem. It's the test on this line: 
http://fisheye1.atlassian.com/browse/springframework/spring/src/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java?r=1.182#l1363
 behaving differently.
                 
                Justin

________________________________

                
                From: Stephen Connolly [mailto:[EMAIL PROTECTED]
                
                Sent: Thu 9/25/2008 12:21 PM 

                To: user@mojo.codehaus.org
                Subject: Re: [mojo-user] test pass normally, but fail under 
cobertura
                

                Noooo
                
                have you got parallel threads in your code?
                
                bet you have even if you thing you have not!
                
                bet you have not read Java Concurrency In Practice and have an 
unintended synchronization side-effect that is currently letting your tests 
pass on Sun's JVM... but they may fail on JRocket or IBM or when instrumented 
with emma/clover/ or cobertura
                
                
                2008/9/25 Edelson, Justin <[EMAIL PROTECTED]>
                

                        Thanks Stephen.
                         
                        Pretty sure it's not a timeout.
                         
                        I agree that tests should be able to be run any number 
of times. And in fact "mvn clean test test test test" works fine. It's "mvn 
cobertura:cobertura" which doesn't - and that only runs tests once.
                         
                        Justin

________________________________

                        From: Stephen Connolly [mailto:[EMAIL PROTECTED]
                        Sent: Thu 9/25/2008 3:09 AM
                        To: user@mojo.codehaus.org
                        Subject: Re: [mojo-user] test pass normally, but fail 
under cobertura
                        
                        
                        I have seen tests fail under cobertura when:
                        
                        1. Tests have timeouts
                        
                        2. Tests make incorrect assumptions about how the JVM 
memory model and synchronization work (or don't)
                        
                        This second one is why I always say run your tests 
twice ;-)
                        
                        
                        2008/9/25 Edelson, Justin <[EMAIL PROTECTED]>
                        

                                I've been struggling for the past 2 days with a 
set of Spring-based integration tests that pass when run normally (i.e. mvn 
test), but fail when run using the cobertura plugin.
                                 
                                I recognize this is a shot in the dark, but if 
anyone has any ideas on things I can try, I'd appreciate it.
                                 
                                Specifically, I'd be interested in any 
differences in the classpath between a normal test run and the cobertura test 
run.
                                 
                                Thanks,
                                Justin





Reply via email to