GitStatusCache: fix race condition in test setup#172
Merged
jamill merged 1 commit intomicrosoft:masterfrom Aug 17, 2018
Merged
Conversation
kewillford
approved these changes
Aug 15, 2018
5639431 to
cf24454
Compare
wilbaker
approved these changes
Aug 15, 2018
jrbriggs
approved these changes
Aug 17, 2018
cf24454 to
e12b192
Compare
This is to fix an issue that happened (intermittently) in the functional tests. There is a race condition where the test is attempting to delete the status cache file, but the status cache might not have been generated for the test repository. To fix this, the test setup will wait for the initial status cache to be generated, so it can proceed from a known state.
e12b192 to
97975e4
Compare
This was referenced Aug 20, 2018
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.
Issue
The following functional test run failed with the following logs from build 18226.25:
Looking at the logs, this test attempted to delete the on disk status cache file before the status cache generation was run. The test assumed that at least the directory containing the status cache file existed before this point. Usually this is the case, but if this logic loses the race with the background status (the status cache directory is usually created just before running the actual git command to generate the status cache), then it will fail.
Fix
The test setup waits for the initial status cache to be generated, so it can proceed from a known state. Waiting for the system to settle down and start from a known state ensures it can handle cases where the status cache is in the middle of being generated, and not cause intermittent test issues later on.
Related issue: #170