-
Notifications
You must be signed in to change notification settings - Fork 21
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: add test that verifies job fails if attachment is accidentally deleted from bucket #436
Conversation
Signed-off-by: Yutong Li <[email protected]>
…deleted from bucket Signed-off-by: Yutong Li <[email protected]>
…-deadline#434) Signed-off-by: Josh Usiskin <[email protected]>
Signed-off-by: Josh Usiskin <[email protected]>
Quality Gate passedIssues Measures |
"parameterValues": [ | ||
{"name": "deadline:targetTaskRunStatus", "value": "SUSPENDED"}, | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this duplicated above in job_parameters
variable?
|
||
# Delete one of the input files from the Job Attachments bucket after confirming that it exists | ||
|
||
s3_client.get_object( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HeadObject is a lighter API call if we just want to check for existence, but if the role doesn't have permission to call it already, don't worry about it.
sessionId=session["sessionId"], | ||
).get("sessionActions") | ||
|
||
logging.info(f"Session actions: {session_actions}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logging.info(f"Session actions: {session_actions}") | |
LOG.info(f"Session actions: {session_actions}") |
Should use same logger as above for consistency. I believe this method goes to root logger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will address in next PR
What was the problem/requirement? (What/Why)
If in the case that an user accidentally deletes a job attachment from the job attachments bucket (or clears the job attachments bucket completely), if a job is running that depends on any of the deleted job attachments, the job should fail at the
syncInputJobAttachments
stage since the job attachment is not able to be synced from the bucket to the worker.We should test that this is indeed what happens, and that the worker is still able to process other jobs after this failure.
What was the solution? (How)
Add a test that
syncInputJobAttachments
step failedsyncInputJobAttachments
session action failed usingListSessionActions
What is the impact of this change?
Better testing for worker agent code and handling failures
How was this change tested?
Was this change documented?
No
Is this a breaking change?
No
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.