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

Merging coverage profiles leads lots of duplicated lines and uses lots of memory #1329

Closed
myzhan opened this issue Jan 5, 2024 · 2 comments

Comments

@myzhan
Copy link
Contributor

myzhan commented Jan 5, 2024

I'm using ginkgo to run the testcases in a project that has 26w lines of code, with the -p flag enabled.

Issues

  1. When running testcases in parallel, more cpu cores lead to more duplicated lines. If I add the -p flag and run on a 64 cores machine, the size of cover.out file is 7.9GB. And the size of cover.out file is 130MB when -p flag removed.
  2. All the coverage files are read into combined buffer, which use lots of memory. And ginkgo will be oom-killed.
@onsi
Copy link
Owner

onsi commented Jan 17, 2024

hey there, thanks for reporting this.

would you be up for trying to fix this? the code that does this currently lives here - it loads everything into memory and simply concatenates them into one massive file.

gocovmerge shows how to do this correctly. we can either take a dependency on gocovmerge and reimplement MergeAndCleanupCoverProfiles using it, or we can reimplement its merge logic in Ginkgo directly. Either is fine with me - though using it seems more straightforward. You shouldn't need any new tests as there is ample integration test coverage for mreging cover files.

let me know if you'd be up for workin on a PR.

@myzhan
Copy link
Contributor Author

myzhan commented Jan 18, 2024

OK, I'll find some time to submit a PR.

myzhan added a commit to myzhan/ginkgo that referenced this issue Jan 20, 2024
onsi pushed a commit that referenced this issue Jan 24, 2024
* merge coverages instead of combining them (#1329)

* add license of gocovmerge
@myzhan myzhan closed this as completed Jan 30, 2024
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

No branches or pull requests

2 participants