Skip to content

Conversation

@mrsolo
Copy link
Contributor

@mrsolo mrsolo commented Feb 10, 2014

Add logic to perform code coverage analysis using jacoco http://www.eclemma.org/jacoco/trunk/doc/

Maven profiles are used so not to disrupt the current build flow. Randomized testing plug-in is moved to the profiles because of configuration conflict if the code is instrumented by jacoco.

@jpountz
Copy link
Contributor

jpountz commented Feb 10, 2014

Do you know if it would somehow possible not to duplicate the randomized-testing configurations between the default profile and the test-coverage profile? Otherwise I'm afraid they would quickly diverge.

@mrsolo
Copy link
Contributor Author

mrsolo commented Feb 11, 2014

Do you know if it would somehow possible not to duplicate the randomized-testing configurations
between the default profile and the test-coverage profile? Otherwise I'm afraid they would quickly
diverge.

There is.

The main issue is this line inside randomizer

- ${tests.jvm.argline} -

That overwrites the coverage use of argLine

[INFO] argLine set to -javaagent:/home/jenkins/.m2/repository/org/jacoco/org.jacoco.agent/0.6.4.201312101107/org.jacoco.agent-0.6.4.201312101107-runtime.jar=destfile=/home/jenkins/workspace/es_coverage_metal/jdk/JDK7/label/metal/target/jacoco.exec,excludes=jsr166e/:jsr166y/:org/apache/lucene/**

and disrupts the instrumentation.

One solution is to move to inherited pom.xml structure. However that requires more extensive work.

a) Parent pom.xml needs to be constructed. Since jar can not be used as a parent pom.

b) For child pom, configuration override and pluginManagement can be used.

@s1monw
Copy link
Contributor

s1monw commented Feb 11, 2014

Can't you just pass what you pass to argLine to -Dtest.jvm.argline instead of the randomized stuff? that should work as well then we don't need to change anything here?

@mrsolo
Copy link
Contributor Author

mrsolo commented Feb 11, 2014

Most likely not since argLine manipulation is done by the jacoco plug in in the build phase?
Reverse may be doable though, that is set argLine based on test.jvm.argline.

I will investigate both cases.

@mrsolo
Copy link
Contributor Author

mrsolo commented Feb 11, 2014

Simplified version submitted. The default profile will only manipulate

${tests.jvm.argline}

With env "tests.jvm.argline=-server -XX:+UseG1GC -XX:+UseCompressedOops" setting
Run with default profile

mvn test

18360 ttys000 0:02.10 /usr/bin/java -Xmx512m -Xss256k -XX:MaxPermSize=128m -XX:MaxDirectMemorySize=512m -Des.logger.prefix= -server -XX:+UseG1GC -XX:+UseCompressedOops -Dtests.prefix=tests -Dtests.seed=51DBEAE652CF827F -Des.logger.level=INFO -Des.node.local= -Des.node.mode= -Djava.awt.headless=true -Djava.io.tmpdir=. -Djava.security.policy=/Users/bhwang/elasticsearch-mrsolo/dev-tools/tests.policy -Djunit4.tempDir=/Users/bhwang/elasticsearch-mrsolo/target -Dtests.appendseed= -Dtests.assertion.disabled= -Dtests.awaitsfix= -Dtests.badapples= -Dtests.class= -Dtests.client.ratio= -Dtests.cluster_seed= -Dtests.enable_mock_modules= -Dtests.failfast= -Dtests.integration= -Dtests.iters= -Dtests.jvm.argline=-server -XX:+UseG1GC -XX:+UseCompressedOops ...

Run with coverage profile

mvn test -Pcoverage

18385 ttys000 0:11.04 /usr/bin/java -Xmx512m -Xss256k -XX:MaxPermSize=128m -XX:MaxDirectMemorySize=512m -Des.logger.prefix= -javaagent:/Users/bhwang/.m2/repository/org/jacoco/org.jacoco.agent/0.6.4.201312101107/org.jacoco.agent-0.6.4.201312101107-runtime.jar=destfile=/Users/bhwang/elasticsearch-mrsolo/target/jacoco.exec,excludes=jsr166e/:jsr166y/:org/apache/lucene/** -Dtests.prefix=tests -Dtests.seed=A92A59D9AA01A3BC -Des.logger.level=INFO -Des.node.local= -Des.node.mode= -Djava.awt.headless=true -Djava.io.tmpdir=. -Djava.security.policy=/Users/bhwang/elasticsearch-mrsolo/dev-tools/tests.policy -Djunit4.tempDir=/Users/bhwang/elasticsearch-mrsolo/target -Dtests.appendseed= -Dtests.assertion.disabled= -Dtests.awaitsfix= -Dtests.badapples= -Dtests.class= -Dtests.client.ratio= -Dtests.cluster_seed= -Dtests.enable_mock_modules= -Dtests.failfast= -Dtests.integration= -Dtests.iters= -Dtests.jvm.argline=-server -XX:+UseG1GC -XX:+UseCompressedOops ...

@s1monw
Copy link
Contributor

s1monw commented Feb 12, 2014

this looks much better to me @jpountz what do you think?

@jpountz
Copy link
Contributor

jpountz commented Feb 14, 2014

I agree, +1 to merge!

@s1monw
Copy link
Contributor

s1monw commented Feb 14, 2014

LGTM +1 bill go ahead and merge it in!

@mrsolo
Copy link
Contributor Author

mrsolo commented Feb 14, 2014

dffc7cd merge to master only

@mrsolo mrsolo closed this Feb 14, 2014
@s1monw
Copy link
Contributor

s1monw commented Feb 14, 2014

can you merge it to 1.x as well I'd like these branches to be as close as possible :)

@mrsolo mrsolo deleted the feature/emma branch February 14, 2014 19:22
@mrsolo
Copy link
Contributor Author

mrsolo commented Feb 14, 2014

Done b38091a

dnhatn added a commit that referenced this pull request Jan 16, 2020
Synced flush was a brilliant idea. It supports instant recoveries with a 
quite small implementation. However, with the presence of sequence
numbers and retention leases, it is no longer needed. This change
removes it from 8.0.

Relates #5077
SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this pull request Jan 23, 2020
Synced flush was a brilliant idea. It supports instant recoveries with a 
quite small implementation. However, with the presence of sequence
numbers and retention leases, it is no longer needed. This change
removes it from 8.0.

Relates elastic#5077
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants