-
Notifications
You must be signed in to change notification settings - Fork 1
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
Adds tasks test for serverless #141
Conversation
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.
Thanks! I think that test is fine, I'm just not seeing what that has to do with not being able to list tasks.
@pquentin I mentioned listing tasks because I don't know how we can get the id of a running task from the API in Serverless to use it in |
Ah got it thanks. You can create a task by calling any API that has a |
Even with the task id, if I understand correctly Serverless won't give information on nodes, and the id needs to be |
I've approved last week already, meaning I'm happy to merge this! I did test however, and yes, this API can be used in Serverless, using those three API calls for example:
The last API call returns this: {
"completed": true,
"task": {
"node": "serverless",
"id": 13676458,
"type": "transport",
"action": "indices:data/write/update/byquery",
"status": {
"total": 0,
"updated": 0,
"created": 0,
"deleted": 0,
"batches": 0,
"version_conflicts": 0,
"noops": 0,
"retries": {
"bulk": 0,
"search": 0
},
"throttled_millis": 0,
"requests_per_second": -1,
"throttled_until_millis": 0
},
"description": "update-by-query [index]",
"start_time_in_millis": 1728904451130,
"running_time_in_nanos": 3922972,
"cancellable": true,
"cancelled": false,
"headers": {
"trace.id": "a0f9f4548e8201332f63305709812b2a"
}
},
"response": {
"took": 3,
"timed_out": false,
"total": 0,
"updated": 0,
"created": 0,
"deleted": 0,
"batches": 0,
"version_conflicts": 0,
"noops": 0,
"retries": {
"bulk": 0,
"search": 0
},
"throttled": "0s",
"throttled_millis": 0,
"requests_per_second": -1,
"throttled_until": "0s",
"throttled_until_millis": 0,
"failures": []
}
} |
86343ec
to
1769208
Compare
Great, thanks @pquentin! I've updated both tasks tests to include this 👍 |
tests/tasks_serverless.yml
Outdated
|
||
- do: | ||
tasks.get: { task_id: $task } | ||
catch: resource_not_found_exception |
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.
This fails for me:
AssertionError: Failed to catch 'resource_not_found_exception' in {'completed': True, ...}
I'm assuming the same applies to the stack test. Should we refactor the common part as well?
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.
Ouch, sorry, that was me not committing the right code! I've updated it to check for a task
key which according to my tests should work even if completed: false
.
1769208
to
6af25fc
Compare
6af25fc
to
19686a7
Compare
AFAIK we can't see the list of tasks in Serverless, so I wrote a test that catches the 404 when trying to get an invalid task.