Conversation
Collaborator
|
Core |
evelyn-ys
approved these changes
Apr 1, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
Fix:
test_credscache_good_error_on_file_corruptionfails when run in parallel with other testsCI failure:
https://dev.azure.com/azure-sdk/playground/_build/results?buildId=806624&view=logs&j=abe8eae2-a613-5a65-3eeb-3e8a13573181&t=ff49c02d-6a40-524c-c9b1-98f6bb13c7f4&l=2248
Root cause
The test
test_credscache_good_error_on_file_corruptionassumes~/.azure/accessTokens.jsonexists when it is run. If there is no~/.azure/accessTokens.json,azure-cli/src/azure-cli-core/azure/cli/core/_profile.py
Line 109 in 50ccb24
evaluates to
False, thus bypassing the code under test, causing failure.This can also be repoed by deleting
~/.azure/accessTokens.jsonand only runningtest_credscache_good_error_on_file_corruption:⚠ In parallel testing, the existence of
~/.azure/accessTokens.jsonis not guaranteed, so the failure.Change
Also patch
os.path.isfileto make the test isolated from the underlying file system.