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

Issue with coverage==5.0 #24

Closed
ghackebeil opened this issue Dec 15, 2019 · 7 comments · Fixed by #25
Closed

Issue with coverage==5.0 #24

ghackebeil opened this issue Dec 15, 2019 · 7 comments · Fixed by #25

Comments

@ghackebeil
Copy link

MPI tests with coverage end with a failure like the following:

================= 156 passed, 36 skipped, 4 warnings in 46.93s =================
Fatal Error on Rank 0
Traceback (most recent call last):
  File "~python3.7/lib/python3.7/site-packages/runtests/mpi/tester.py", line 333, in main
    code = self._test(config, comm=self.comm, **covargs)
  File "~/python3.7/lib/python3.7/site-packages/runtests/tester.py", line 275, in _test
    return config.hook.pytest_cmdline_main(config=config)
  File "~/python3.7/lib/python3.7/site-packages/runtests/coverage.py", line 60, in __exit__
    self.cov.stop()
AttributeError: 'CoverageData' object has no attribute 'write_file'
--------------------------------------------------------------------

Issue goes away if I revert to coverage==4.5.4

@rainwoodman
Copy link
Member

It looks like coverage=5.0 changed how the path to the coverage data is dictated -- instead of determining the file name at write, it must be determined when the coverage object is created.

We need to move some of the logic in exit of coverage.py to enter. Probably shall always modify cov.config.data_file to a temporary location regardless of number of ranks, then in exit depending on the number of ranks combine or rename the coverage result.

@nickhand, any comments on this approach?

@rainwoodman
Copy link
Member

I think the issue has creepped into nbodykit main test suite.

https://travis-ci.org/bccp/nbodykit/jobs/631984492

We need to sort this out.

@rainwoodman rainwoodman pinned this issue Jan 3, 2020
@nickhand
Copy link
Member

nickhand commented Jan 3, 2020

@rainwoodman I can take a look this weekend and offer some comments

@rainwoodman
Copy link
Member

Great!

@nickhand
Copy link
Member

nickhand commented Jan 4, 2020

It looks like write_file() was re-named to write() in coverage >= 5. The fix might be as simple as checking to see which of those functions exists and calling the right one

@nickhand
Copy link
Member

nickhand commented Jan 4, 2020

I think the rest of the logic still works. They changed the underlying data format from a JSON file to a SQLite database file, but the current logic doesn't depend on the storage format

@rainwoodman
Copy link
Member

It does depend on how the storage logic is executed -- the storage containers are created before write occurs, thus we had to lift the file names to before cov.start().

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 a pull request may close this issue.

3 participants