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

close files in tests and before raising exception in get_open_msa_slits #7599

Merged
merged 2 commits into from
Jun 10, 2023

Conversation

braingram
Copy link
Collaborator

@braingram braingram commented Jun 9, 2023

jwst downstream tests have been failing in stdatamodels because of numerous pytest.PytestUnraisableExceptionWarning warnings as a result of ResourceWarning warnings from unclosed files.

https://github.com/spacetelescope/stdatamodels/actions/runs/5215436542/jobs/9412973900

jwst does not currently convert these PytestUnraisableExceptionWarning warnings into errors but the warnings can be seen in the log files for CI runs:
https://github.com/spacetelescope/jwst/actions/runs/5157043601/jobs/9288891837#step:10:169

The changes in this PR are mostly to tests to close opened files but also includes a minor change to get_open_msa_slits to close a file prior to raising an exception.

This does not address all of the warnings as some are due to code in stdatamodels. A corresponding stdatmodels PR to fix those issues is:
spacetelescope/stdatamodels#169

and an example PR that sets the stdatamodels dependency to the source branch of the above stdatamodels PR is here (to hopefully demonstrate that all errors are addressed by the two PRs):
#7601
the CI shows no more PytestUnraisableExceptionWarning warnings
https://github.com/spacetelescope/jwst/actions/runs/5225497772/jobs/9435044814
but does show 2 test failures:

I don't believe the merging of this and the stdatamodels PR need to be coordinated as the changes in each are independent (but both address similar issues).

Checklist for maintainers

  • added entry in CHANGES.rst within the relevant release section
  • updated or added relevant tests
  • updated relevant documentation
  • added relevant milestone
  • added relevant label(s)
  • ran regression tests, post a link to the Jenkins job below.
    How to run regression tests on a PR
  • Make sure the JIRA ticket is resolved properly

@codecov
Copy link

codecov bot commented Jun 9, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (21c7b51) 77.48% compared to head (78948f7) 77.48%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7599   +/-   ##
=======================================
  Coverage   77.48%   77.48%           
=======================================
  Files         456      456           
  Lines       36591    36592    +1     
=======================================
+ Hits        28354    28355    +1     
  Misses       8237     8237           
Flag Coverage Δ *Carryforward flag
nightly 77.54% <ø> (ø) Carriedforward from 21c7b51

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
jwst/assign_wcs/nirspec.py 94.03% <100.00%> (+<0.01%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@braingram
Copy link
Collaborator Author

Regression tests (without the corresponding stdatamodels changes): https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/736/

Copy link
Collaborator

@nden nden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@braingram braingram marked this pull request as ready for review June 9, 2023 21:14
@braingram braingram requested a review from a team as a code owner June 9, 2023 21:14
@nden nden merged commit c20b833 into spacetelescope:master Jun 10, 2023
@braingram braingram deleted the open_files_in_tests branch June 11, 2023 20:50
mairanteodoro pushed a commit to mairanteodoro/jwst that referenced this pull request Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants