Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Infinite loop generating code coverage in v1.2.0+ on the command line

Discussion in 'Testing & Automation' started by blaine_grady, Jan 26, 2023.

  1. blaine_grady

    blaine_grady

    Joined:
    Aug 17, 2022
    Posts:
    7
    I was using code coverage v1.1.1 and generating a report on our build server. I am running edit mode and play mode tests and then combining the results into one report.

    In v1.1.1, it would log the following lines.
    I upgraded to 1.2.2 and it now logs the following lines.
    The last block repeats forever and keeps generating files in sequence until the build process kills it after 1 hour. I verified the same issue occurs in 1.2.0 and 1.2.1.

    It is running the following command.
    I am using test framework v1.1.33.

    Any thoughts on what could be causing the infinite loop? Thanks.
     
  2. Unity-Nikos

    Unity-Nikos

    Unity Technologies

    Joined:
    Sep 30, 2015
    Posts:
    87
    Hi @blaine_grady, the reason for getting repeating OpenCover sessions is that the generateTestReferences is passed, and therefore an xml file is generated after every individual test run. This feature is not yet well optimised for bigger projects with a lot of tests.

    Could you please remove this option from your command and rerun? Thank you
     
  3. blaine_grady

    blaine_grady

    Joined:
    Aug 17, 2022
    Posts:
    7
    @Unity-Nikos I removed that option and it now finishes in a reasonable time. Thanks.

    Now I can generate the full report, but it is significantly different from the previous version. I ran the same report with everything the same (including not using the affected option) except changing the code coverage package version. I tested 1.0.1 and 1.2.2. Both give me the same coverable lines of ~130,000. The 1.2.2 report reduced the covered lines by almost 1,500. I found a method where the 1.0.1 report says it is covered but the 1.2.2 report says it is not. I ran the debugger and verified that method is in fact covered by the unit tests. This seems like the 1.2.2 code coverage analysis is incorrect.
     
  4. Unity-Nikos

    Unity-Nikos

    Unity Technologies

    Joined:
    Sep 30, 2015
    Posts:
    87
    Would you be able to submit a bug report with your project or a small repro project and share the incident ID? Can you identify anything different with that method?

    Also, I noticed that you're using the -burst-disable-compilation command line argument which is incorrect. It appears that our documentation had a typo. We'll update it with a correct argument, which is --burst-disable-compilation (notice double dash at the front). Until we release a new package version with the fix, you will need to add both of them - one which actually works and the other which is (incorrectly) expected by the package.
     
  5. blaine_grady

    blaine_grady

    Joined:
    Aug 17, 2022
    Posts:
    7
    @Unity-Nikos I submitted a bug report with incident ID IN-30203. It looks like it cannot properly analyze generic methods.

    Thanks for the update on the burst argument.
     
    JimboJonesBL likes this.
  6. Unity-Nikos

    Unity-Nikos

    Unity Technologies

    Joined:
    Sep 30, 2015
    Posts:
    87
    Thank you @blaine_grady. We will triage your incident and if it is related to the generic methods issue, it is a known issue and can be tracked here.
     
  7. Unity-Nikos

    Unity-Nikos

    Unity Technologies

    Joined:
    Sep 30, 2015
    Posts:
    87
    Hi @blaine_grady. We have released Code Coverage package version 1.2.3 which fixes the generics issue. Generic methods should display correct coverage once again. This version implements the correct number of dashes for --burst-disable-compilation too.
     
    Last edited: Apr 15, 2023