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

test_import.py cannot run twice #1444

Closed
samwaseda opened this issue May 23, 2024 · 7 comments
Closed

test_import.py cannot run twice #1444

samwaseda opened this issue May 23, 2024 · 7 comments

Comments

@samwaseda
Copy link
Member

test_import.py cannot run twice because somehow pyiron fails to delete jobs in the first run when the tests finish. In the second run these remaining jobs from the first run apparently make a problem.

@samwaseda
Copy link
Member Author

samwaseda commented May 23, 2024

It looks like there are multiple entries created when the jobs are imported with the same job name. On top of this, it looks like the job has itself as a child job, so that when it tries to delete the child job, it cannot identify the job.

@samwaseda
Copy link
Member Author

So I'm not getting any comment here but I'm gonna keep posting my findings to use it as my log book.

  • The problem does not occur with the newly updated import and export example. That's a good sign.
  • Also, when each test is executed individually, there's no error/problem
  • Based on this, I thought moving everything from setUpClass to setUp (same for tearDownClass) could solve the problem, but this created other problems.

@pmrv
Copy link
Contributor

pmrv commented May 23, 2024

Ah, I remember this issue when running tests locally. It might have been that the project that the test imports into is not the same as the one that gets cleared after the test, but I'm not sure anymore and I never quite fixed it.

@liamhuber
Copy link
Member

Ah, I remember this issue when running tests locally. It might have been that the project that the test imports into is not the same as the one that gets cleared after the test, but I'm not sure anymore and I never quite fixed it.

Ditto. I even still have a fix_archive_tests branch on my local repo that I'm pretty sure was trying to address exactly this, but I got frustrated and quit before I got it solved.

@samwaseda
Copy link
Member Author

Yeah it's super frustrating, especially the errors are really not helpful.

I kept digging down, and now I got the feeling that there's a problem with nested projects. It occurs namely even when there are only these two tests: test_unpack_to_nested_project and test_unpack_from_other_dir_uncompress, but somehow if each of them is run individually the problem does not occur.

@samwaseda
Copy link
Member Author

It looks like the opposite is also the case: if I run all tests except for these two, they pass as well.

@samwaseda
Copy link
Member Author

Interestingly, there’s also no problem if only one of them is disabled. So probably something in tearDownClass prevents the problem.

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

No branches or pull requests

3 participants