Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aspect method invoking chain doesn't have right coverage data #1543

Open
sanmuqingliang opened this issue Nov 20, 2023 · 3 comments
Open

Aspect method invoking chain doesn't have right coverage data #1543

sanmuqingliang opened this issue Nov 20, 2023 · 3 comments
Labels
reproducer required Further information is requested type: bug 🐛 Something isn't working

Comments

@sanmuqingliang
Copy link

sanmuqingliang commented Nov 20, 2023

Steps to reproduce

  • JaCoCo version: v0.8.10
  • Operating system: Linux X86 64bit
  • Tool integration: we use on-the-fly instrumenting class and Jacoco java agent
  • Complete executable reproducer: sorry, there is't
  • Steps:
    As shown in picture 1, the api method has an aspect(which is an around aspect), and from picture 2, we see the aspect method invoke the next method ”getLegInstIds“, which is in picture 3.
    From the api method's coverage data which is all green in picture 1 , and the aspect method coverage data which is green and yellow in picture 2, the "getLegInstIds" method should have been invoked, but in picture 3, we see the "getLegInstIds" method doesn't have coverage data.
    It isn't a problem with report generating, I checked the exec file's data, and found the "getLegInstIds" method probes were false. I found this issue Line Calling Method which Throws Exception Incorrectly Reported as not Covered #1360, but seems it isn't the same. Because the whole api method is all green, it means it doesn't throw an exception.
    Is this a known issue of Jacoco? Or Have I investigate the problem further?

picture 1:
step1

picture 2:
step2

picture 3:
step3

@sanmuqingliang sanmuqingliang added the type: bug 🐛 Something isn't working label Nov 20, 2023
@marchof
Copy link
Member

marchof commented Nov 21, 2023

Hi @sanmuqingliang This really depends on the aspect system you're using and how this is integrated with JaCoCo. Maybe the aspect code is inlined?

If you want to have someone look into this please provide an minimal, executable reproducer.

@marchof marchof added the reproducer required Further information is requested label Nov 21, 2023
@sanmuqingliang
Copy link
Author

Hi @sanmuqingliang This really depends on the aspect system you're using and how this is integrated with JaCoCo. Maybe the aspect code is inlined?

If you want to have someone look into this please provide an minimal, executable reproducer.

Hi @marchof Thx for the advice. Because that is our product code, providing an executable reproducer is somewhat difficult. As I checked the code, the aspect was using Spring AOP. We used on-the-fly jacoco agent, I got and decompiled the byte code from the JVM instance which has been changed by Jacoco, and I also checked the probes' value from the exec file, I didn't find anything strange and didn't know how to find the root cause by myself. Could you help to give me some instructions on how to investigate this problem further?

@marchof
Copy link
Member

marchof commented Jan 4, 2024

Having literally no experience with the toolstack you're using there is really no advice I can give you. As said before: If you want someone to spend some time on this issue you have to spend your time for an isolated reproducer first. Also creating a minimal reproducer often helps to understand a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reproducer required Further information is requested type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants