-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[Storage][tests] Use "Exists" APIs to improve test reliability #10200
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
Conversation
|
/azp run net - storage - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
- In test code, all calls to ShareClient.Create() were replaced by ShareClient.CreateIfNotExists(), with the exception of calls explicitly testing Create(). - Even if the share does not exist, ShareClient.Create() can throw ShareAlreadyExists if the server failed to respond to the first HTTP request and it was retried
- In test code, all calls to ShareDirectoryClient.Create() were replaced by ShareDirectoryClient.CreateIfNotExists(), with the exception of calls explicitly testing Create(). - Even if the directory does not exist, ShareDirectoryClient.Create() can throw ResourceAlreadyExists if the server failed to respond to the first HTTP request and it was retried
0f78b48 to
b4834c7
Compare
|
/azp run net - storage - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@tg-msft, @JoshLove-msft: Looks like this PR was forgotten. I just rebased against |
|
@tg-msft, @JoshLove-msft: Recorded tests are failing. If I recall, it's because the recordings need to be updated since the |
|
@amishra-dev, @seanmcc-msft: Would either of you like to review this, and would you prefer I merge this to |
|
Hi @mikeharder , could you merge this to |
|
@seanmcc-msft: Sure, I will merge to both those branches once this is ready. |
|
Is this PR still moving forward? |
|
@Petermarcu: Yes. @tg-msft has agreed to update the test recordings and then merge this PR. |
|
I'm not sure if this PR is necessary. The majority of our unit tests use DisposableContainer/Share/FileSystem, which are created at the beginning of the test, and deleted in a finally loop at the end of the test. Even if the containers were not deleted, new ones are created the next time a test is run. I'm not sure how we would ever run into a conflicting Blob/SMB File/Data Lake File. |
This PR will improve test reliability. Further, I think we should encourage customers to use the The non-
The only way to avoid these occasional exceptions is to use the |
|
@tg-msft - Are you still planning to update and merge or can this be closed out? |
|
@mikeharder - Is this still an active work stream or should we close out the PR? |
|
I put a fair bit of work into this, and it's important for test reliability, so I would like to see it get merged. I believe the remaining work is for someone to update the recordings and commit them with the test changes. @tg-msft has agreed to do this when he gets time. |
I was planning on re-recording these in a separate PR. |
|
@JoshLove-msft - Is there an issue that we can link with this for the remaining work to keep apprised of scheduling? |
|
My changes were made a long time ago, so whomever takes over this PR should also see if any new tests were added since my changes, and update them in the same way (always use an "Exists" API, unless you are explicitly testing the non-Exists API). |
|
Fixed with #15638 |
In test code, all calls to Create() or Delete() were replaced by CreateIfNotExists() and DeleteIfExists(), with the exception of calls explicitly testing Create() or Delete(), and calls which require the response (since the "Exists" APIs may return a null response).
The non-"Exists" APIs may fail at any time if the server failed to respond to the first HTTP request and it was retried
PRs which added "Exists" APIs to product code