In my experience you have:
  * a 40% chance of the failure being a bad test
  * a 40% chance of the failure being a bug in your production code
  * a 20% chance of the failure being a side-effect of instrumentation
which invalidates the test

If you and all the developers in your team cannot explain what will be
output by the example code on page 33 of Java Concurrency In Practice
( http://jcip.net/listings/NoVisibility.java ) and why then please
please Run the Damn Tests Twice

If you can explain, then you will run the damn tests twice anyway.

The above example is just one way where the JVM spec can confuse you...

There are others which have nothing to do with concurrency, but I
don't have handy links to them.

Just Run The Damn Tests Twice(TM)

-Stephen

On 27 September 2011 12:14, Miguel Almeida <[email protected]> wrote:
> Thank you for pointing out to that discussion.  Even though I don't agree
> completely - if running the coverage tool Cobertura changes the status of
> your tests, I'd say that in most likelihood the problem should be cobertura
> and not your code or your test - I might live with running the cobertura
> goal separately and even move it to the CI system: it delays quick feedback
> to the developer locally anyway.
>
> Miguel Almeida
>
> On Mon, Sep 26, 2011 at 4:08 PM, Stephen Connolly <
> [email protected]> wrote:
>
>> http://maven.40175.n5.nabble.com/Cobertura-and-Surefire-td3338334.html
>>
>
>
>
>> On 26 September 2011 15:46, Miguel Almeida <[email protected]>
>> wrote:
>> > I am using the cobertura plugin to create test coverage reports, and
>> > surefire-report for test reports. See [1] for my maven 3 configuration on
>> > the top-tier of a multi-module project.
>> > The goals I am running are:
>> >
>> > Surefire: surefire-report:report
>> > Cobertura: cobertura:cobertura
>> >
>> > Is it possible to run the both reports in the same run *withou*t *running
>> > the tests twice*? I have tried two approaches:
>> >
>> > 1) mvn both goals
>> > 2) Site: site:site
>> >
>> > However, because site:site ran for too long (more than 2 minutes, vs a 30
>> > second surefire-report), I inspected its output, and found out it was
>> > running each test twice (eg, I found two string matches of "Running
>> > org.iwrs.web.IndexActionTest").
>> >
>> > To reduce total goal time, can *tests run once and produce surefire and
>> > cobertura reports*?
>> >
>> > Thank you,
>> >
>> > Miguel Almeida
>> >
>> > [1]
>> > <plugins>
>> >            <plugin>
>> >                <groupId>org.apache.maven.plugins</groupId>
>> >                <artifactId>maven-site-plugin</artifactId>
>> >                <version>3.0-beta-3</version>
>> >                <configuration>
>> >                    <reportPlugins>
>> >                        <plugin>
>> >                            <groupId>org.apache.maven.plugins</groupId>
>> >                            <artifactId>maven-javadoc-plugin</artifactId>
>> >                            <version>2.7</version>
>> >                        </plugin>
>> >                        <plugin>
>> >                            <groupId>org.apache.maven.plugins</groupId>
>> >
>> > <artifactId>maven-surefire-report-plugin</artifactId>
>> >                            <version>2.6</version>
>> >                        </plugin>
>> >                        <plugin>
>> >                            <groupId>org.codehaus.mojo</groupId>
>> >
>>  <artifactId>cobertura-maven-plugin</artifactId>
>> >                            <configuration>
>> >                                <instrumentation>
>> >                                    <excludes>
>> >
>> > <exclude>com/work/**/*Fake*.class</exclude>
>> >                                    </excludes>
>> >                                </instrumentation>
>> >                            </configuration>
>> >                        </plugin>
>> >                    </reportPlugins>
>> >                </configuration>
>> >            </plugin>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to