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

attempt to clean local directory before setting up test files #510

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

pretendWhale
Copy link
Contributor

Currently in some situations (such as when an autotest worker is unexpectedly killed), files can fail to be cleaned up at the end of a test run. This can result in subsequent test runs reporting an error like [Errno 1] Operation not permitted: '/home/docker/.autotesting/workers/autotst0/__pycache__'

However, the files are still cleaned up at the end of the test run, so subsequent test runs do not return this error.

This PR adds an attempt to clear the worker directory before setting up the assignment's files, in case there are leftover files from a previous test run.

Steps to reproduce the behavior locally:

  1. In server/docker-onfig.yml comment out lines 7 onwards and restart the server so it only runs one worker (for convenience)
  2. sudo -u autotst0 -- mkdir autotst0/__pycache__
  3. sudo -u autotst0 -- touch autotst0/__pycache__/test.txt
  4. sudo -u autotst0 -- chmod a-rx autotst0/__pycache__/
  5. sudo -u autotst0 -- chmod u+rx autotst0/__pycache__/

I added one test, but note that it is largely redundant with Donny's

@pretendWhale pretendWhale added this to the v2.4.3 milestone Apr 22, 2024
@david-yz-liu
Copy link
Contributor

@pretendWhale please merge/rebase this branch from master.

@pretendWhale
Copy link
Contributor Author

@david-yz-liu Done! 👍

@david-yz-liu david-yz-liu merged commit 9c4c641 into MarkUsProject:master Apr 24, 2024
13 checks passed
donny-wong pushed a commit to donny-wong/markus-autotesting that referenced this pull request May 9, 2024
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 this pull request may close these issues.

3 participants