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

get coverage data fail #1761

Closed
850319644 opened this issue Apr 9, 2024 · 2 comments
Closed

get coverage data fail #1761

850319644 opened this issue Apr 9, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@850319644
Copy link

Describe the bug
Use the coverage api to count code coverage, and call erase after each data acquisition. The code coverage can be counted for a while. After a while, it is found that the code coverage cannot be counted. When calling the get_data function, it will prompt that the data is not obtained.

Error info:
Coverage.py warning: No data was collected. (no-data-collected)

Code:
cov = coverage.Coverage(branch=True, data_suffix=True, config_file=".coveragerc", include=[u'/data/ibox/app/cgi/*'])
cov.start()

while True:
time.sleep(report_frequency)
try:
cover.stop()
LOG.log_info("stop coverage")
reporter.report()
except Exception as e:
LOG.log_exception("report data error: %s", e)
cover.erase()
LOG.log_info("start coverage")
cover.start()
LOG.log_info("start coverage")

@850319644 850319644 added bug Something isn't working needs triage labels Apr 9, 2024
@nedbat
Copy link
Owner

nedbat commented Apr 9, 2024

Hi, sorry you are having trouble. We'll need more information. You haven't said what your main program is doing. Perhaps it's not running any more after some time? Can you provide a reproducible example?

@nedbat nedbat added question Further information is requested and removed needs triage labels Apr 9, 2024
@nedbat
Copy link
Owner

nedbat commented May 9, 2024

When you get more information, feel free to add it, and I can re-open the issue.

@nedbat nedbat closed this as completed May 9, 2024
@nedbat nedbat removed the question Further information is requested label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants