Waiting for test-run completion#3
Conversation
(see comment inside the code)
There was a problem hiding this comment.
This should not happen as self.get_token() is called before each HTTP request, and get_token uses refresh token to retrieve a new token if the current one is expired. The expiration time for refresh token in our backend is currently 3600seconds so if the access token is expired the new access token is retrieved:
https://github.com/bitbar/testdroid-api-client-python/blob/master/testdroid/__init__.py#L130
There was a problem hiding this comment.
Thanks for your comment.
I have added the workaround because i saw (and quoted) token expiry error triggering despite this line:
https://github.com/bitbar/testdroid-api-client-python/blob/master/testdroid/__init__.py#L130
In other words: what you say should happen, isn't happening. I urge you to comment out the workaround and see for yourself. You need a relatively long-running job.
Note that I have now added an additional commit (added the result download function)
There was a problem hiding this comment.
Ok, I think that there is two cases(at least) when this could happen:
- Backend has lost all the tokens during server update/restart (
- Another api client has already request a new token using refresh token(frontend is currently using the same token so it might have requested a new token when python client is still trying using the old one)
Otherwise the script output needs parsing.
Waiting for test-run completion
It's difficult to use the python client for test-run completion.
One needs to write a bash script that parses the stdout coming out from various commands:
This cannot be done with python if only, because start_test_run does not return the job id (it only prints it out).
Since anyone using this client will be interested in knowing when the job is finished, i thought I propose to enable it at the very root and propose this change.