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

Checking if directory is deleted before copying #431

Closed
wants to merge 2 commits into from

Conversation

nmerket
Copy link
Member

@nmerket nmerket commented Feb 19, 2024

Pull Request Description

Checks to see if the directory on local scratch is empty before copying to it.

Checklist

Not all may apply

  • Code changes (must work)
  • Tests exercising your feature/bug fix (check coverage report on Checks -> BuildStockBatch Tests -> Artifacts)
  • Coverage has increased or at least not decreased. Update minimum_coverage in .github/workflows/coverage.yml as necessary.
  • All other unit and integration tests passing
  • Update validation for project config yaml file changes
  • Update existing documentation
  • Run a small batch run on Kestrel/Eagle to make sure it all works if you made changes that will affect Kestrel/Eagle
  • Add to the changelog_dev.rst file and propose migration text in the pull request

@@ -111,7 +111,11 @@ def results_dir(self):
def clear_and_copy_dir(src, dst):
if os.path.exists(dst):
shutil.rmtree(dst, ignore_errors=True)
shutil.copytree(src, dst)
while True:
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe this should have a limit of the number of times it can run and error out so it doesn't hang forever if the file doesn't ever delete and it's not just a weird race condition. I'll fix that.

@nmerket nmerket changed the title checking if directory is deleted before copying Checking if directory is deleted before copying Feb 19, 2024
Copy link

File Coverage
All files 86%
base.py 91%
exc.py 57%
hpc.py 78%
local.py 70%
postprocessing.py 84%
utils.py 91%
cloud/docker_base.py 89%
sampler/base.py 79%
sampler/downselect.py 33%
sampler/precomputed.py 93%
sampler/residential_quota.py 61%
test/shared_testing_stuff.py 85%
test/test_docker.py 33%
test/test_local.py 97%
test/test_validation.py 97%
workflow_generator/base.py 90%
workflow_generator/commercial.py 53%
workflow_generator/residential_hpxml.py 86%

Minimum allowed coverage is 33%

Generated by 🐒 cobertura-action against 48bd8ed

@afontani afontani added the DO NOT MERGE PR is open but please don't merge! label Mar 6, 2024
@nmerket
Copy link
Member Author

nmerket commented Mar 6, 2024

This didn't address the issue they were having as it wasn't a race condition. The actual fix is #438.

@nmerket nmerket closed this Mar 6, 2024
@nmerket nmerket deleted the local_dir_copy_bugfix branch March 6, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DO NOT MERGE PR is open but please don't merge!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants