Skip to content

Fix premature cleanup in code coverage with multiple IsMain processes #1111

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gusbro
Copy link
Contributor

@gusbro gusbro commented Feb 25, 2025

  • There are some scenarios where a single process executes GeneXus objects which end up with IsMain being true
    For example, some GXTest/GXFlow code instantiates procedures without passing them a GxContext.
    This was making the coverage trace file to try a premature cleanup and the need to start another coverage session
  • Add a specific Id for .NET code coverage sessions (Id=3)
  • Add a public static OnExit entry to allow for third party code which instantiates objects that end up being marked as Main in the same process to do a proper cleanup before exiting the last object.
  • Update OnExit/1 to be more resilient by ensuring every DbgItem with ticks not set to have a valid tick count
  • Add (conditionally compiled) code to generate a verbose log file of the trace being written. To enable this trace you have to build GxClasses.dll with _LOG_WRITER symbol defined

Issue: 202777

Gustavo Brown Rodriguez added 2 commits February 25, 2025 13:08
There are some scenarios where a single process executes GeneXus objects which end up with IsMain being true
For example, some GXTest/GXFlow code instantiates procedures without passing them a GxContext.
This was making the coverage trace file to try a premature cleanup and the need to start another coverage session
- add a specific Id for .NET code coverage sessions (Id=3)
- Add a public static OnExit entry to allow for third party code which instantiates objects that end up being marked as Main in the same process to do a proper cleanup before exiting the last object.
- Update OnExit/1 to be more resilient by ensuring every DbgItem with ticks not set to have a valid tick count
- Add (conditionally compiled) code to generate a verbose log file of the trace being written. To enable this trace you have to build GxClasses.dll with  _LOG_WRITER symbol defined

Issue: 202777
@gusbro gusbro temporarily deployed to external-storage-tests February 25, 2025 16:52 — with GitHub Actions Inactive
@genexusbot
Copy link
Collaborator

Cherry pick to beta success

@gusbro gusbro changed the title Fix/issue202777 Fix premature cleanup in code coverage with multiple IsMain processes May 2, 2025
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