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

Using $write_file in several testcases with the same filename makes skivvy unable to cleanup tempfiles #5

Open
hyrfilm opened this issue Mar 21, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@hyrfilm
Copy link
Owner

hyrfilm commented Mar 21, 2023

If several test-cases write to the same file, using $write_file skivvy can't clean up the temporary files.
In general, it's a bad idea to write to the same file because the result would be over-written. But skivvy shouldn't crash like this. Most likely because it keeps the files to clean up in a list and not a set.

This stacktrace below is where several calls have used a $write_file set to fixture_db.txt:

  File "/usr/local/bin/skivvy", line 8, in <module>
    sys.exit(run_skivvy())
  File "/usr/local/lib/python2.7/site-packages/skivvy/skivvy.py", line 226, in run_skivvy
    result = run()
  File "/usr/local/lib/python2.7/site-packages/skivvy/skivvy.py", line 207, in run
    file_util.cleanup_tmp_files()
  File "/usr/local/lib/python2.7/site-packages/skivvy/util/file_util.py", line 32, in cleanup_tmp_files
    os.remove(filename)
OSError: [Errno 2] No such file or directory: 'fixture_db.txt'```
@hyrfilm hyrfilm added the bug Something isn't working label Mar 21, 2023
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

1 participant