[JBoss JIRA] (JBTM-2553) Investigate the test with byteman do not work with the jacoco
by Amos Feng (JIRA)
[ https://issues.jboss.org/browse/JBTM-2553?page=com.atlassian.jira.plugin.... ]
Amos Feng commented on JBTM-2553:
---------------------------------
yeah, $0 works in the fail2pc.btm but it looks like the $this does work in the commitMarkableResourceFailAfterCommit.btm
{code}
RULE Fail first phase2Commit
CLASS com.arjuna.ats.arjuna.coordinator.BasicAction
METHOD doCommit
AT EXIT
BIND NOTHING
IF readCounter("phase2commit") == 0
DO debug("Called"),
incrementCounter("phase2commit");
com.arjuna.ats.arjuna.coordinator.ActionManager.manager().remove($this.get_uid());
throw new Error();
ENDRULE
RULE Return not inflight
CLASS com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule
METHOD isTransactionInMidFlight
AT ENTRY
BIND NOTHING
IF TRUE
DO
RETURN false;
ENDRULE
{code}
The "Fail first phase2Commit" is triggered but the "Return not inflight" does not been installed. The other issue is that the jacoco could change the ordering of the elements in the recordList as the first XAResource is not the one expected.
you can see the failure with running
{code}
./build.sh -f ArjunaJTA/jta/pom.xml clean test -Dtest=TestCommitMarkableResourceFailActivate -Dorg.jboss.byteman.verbose -PcodeCoverage
{code}
> Investigate the test with byteman do not work with the jacoco
> -------------------------------------------------------------
>
> Key: JBTM-2553
> URL: https://issues.jboss.org/browse/JBTM-2553
> Project: JBoss Transaction Manager
> Issue Type: Sub-task
> Components: Testing
> Reporter: Amos Feng
> Assignee: Amos Feng
> Fix For: 5.next
>
>
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 12 months
[JBoss JIRA] (JBTM-2553) Investigate the test with byteman do not work with the jacoco
by Andrew Dinn (JIRA)
[ https://issues.jboss.org/browse/JBTM-2553?page=com.atlassian.jira.plugin.... ]
Andrew Dinn commented on JBTM-2553:
-----------------------------------
Hi Tom,
One reason I know why this is so complex is that I found out that the latest version of Byteman is subject to the same issue i.e. it also shifts the start offset of this and parameter variables when it injects AT ENTRY (I have not yet found a test case for it but I think I will be able to reproduce the error Amos has seen by injecting multiple AT ENTRY rules into the same method). I have made several different attempts to fix the problem but so far none of them has worked. I'll continue to pursue this matter and let you know when I get something I can offer to the Jacoco team.
As you say, the simple workaround is indeed to disable Byteman tests when checking coverage. However, there is a better alternative -- modify the affected rules so that they reference this and/or parameters using the indexed parameter syntax $0, $1 etc. This is slightly less readable but does allow the tests can be included in the coverage analysis. giving a much more realistic assessment of test coverage for some parts of the code (e.g. crash recovery).
> Investigate the test with byteman do not work with the jacoco
> -------------------------------------------------------------
>
> Key: JBTM-2553
> URL: https://issues.jboss.org/browse/JBTM-2553
> Project: JBoss Transaction Manager
> Issue Type: Sub-task
> Components: Testing
> Reporter: Amos Feng
> Assignee: Amos Feng
> Fix For: 5.next
>
>
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 12 months
[JBoss JIRA] (JBTM-2553) Investigate the test with byteman do not work with the jacoco
by Tom Jenkinson (JIRA)
[ https://issues.jboss.org/browse/JBTM-2553?page=com.atlassian.jira.plugin.... ]
Tom Jenkinson edited comment on JBTM-2553 at 12/2/15 5:11 AM:
--------------------------------------------------------------
Thanks for the detailed explanation Andrew - it certainly sounds a complex issue. Do you know of any other coverage frameworks that Byteman might interoperate with today? If not we can just disable the byteman tests under coverage testing. If you do get a Jacoco issue reference please can you let us know so we can reference it here? Thanks again!
was (Author: tomjenkinson):
Thanks for the detailed explanation Andrew - it certainly sounds a complex issue. Do you know of any other coverage frameworks that Byteman might interoperate with today? If not we can just disable it. If you do get a Jacoco issue reference please can you let us know so we can reference it here? Thanks again!
> Investigate the test with byteman do not work with the jacoco
> -------------------------------------------------------------
>
> Key: JBTM-2553
> URL: https://issues.jboss.org/browse/JBTM-2553
> Project: JBoss Transaction Manager
> Issue Type: Sub-task
> Components: Testing
> Reporter: Amos Feng
> Assignee: Amos Feng
> Fix For: 5.next
>
>
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 12 months