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

Repeated CoverageData.updates cause problems #415

Closed
nedbat opened this issue Sep 28, 2015 · 2 comments
Closed

Repeated CoverageData.updates cause problems #415

nedbat opened this issue Sep 28, 2015 · 2 comments
Labels
bug Something isn't working combine

Comments

@nedbat
Copy link
Owner

nedbat commented Sep 28, 2015

Originally reported by Anonymous


Attempting to use the API to get the following behavior:

  • collect coverage during each "test run" which is a single path of API calls
  • clear the coverage at the end of each such "run" so that the system can tell what was covered during each run
  • keep a CoverageData with all information across "test runs" so that at the end of testing a report over all test runs can be produced

https://github.com/agroce/tstl/blob/master/src/static/boilerplate_cov.py

has the critical code. Basic structure is just:

if self.oldCovData == None:
    self.oldCovData = newCov
else:
    self.oldCovData.write_file("bug_report.coverage")
    self.oldCovData.update(newCov)

(the write_file is just for bug reporting)

When done without write_file, it hangs and grabs most of CPU/large amounts of RAM. With write_file, the timeout causes testing to stop before that can happen, but the coverage file is huge and claims large numbers of processes. Only testing one program, a simple AVL tree.

Coverage data file is attached.

Note that I also see behavior where it appears that:

  • calling .get_data twice, the second call returns None, but if new coverage is added by executing the code being measure, get_data returns an object that has not (as API docs indicate) cleared out the old data. Not sure if this is related, but it explains the call to erase in the code linked on github.

@nedbat
Copy link
Owner Author

nedbat commented Oct 6, 2015

I've already changed the .get_data() to not return None the second time. Does that help?

@nedbat
Copy link
Owner Author

nedbat commented Oct 10, 2015

I believe this is due to an extreme proliferation of brief_sys data in the .coverage file. I've removed that in 088704cc33ec (bb), let me know how it seems now.

@nedbat nedbat closed this as completed Oct 10, 2015
@nedbat nedbat added major bug Something isn't working combine labels Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working combine
Projects
None yet
Development

No branches or pull requests

1 participant