Skip to content

Fix LooseObjectStepTests#68

Merged
derrickstolee merged 3 commits intomicrosoft:masterfrom
derrickstolee:loose-objects
Aug 19, 2019
Merged

Fix LooseObjectStepTests#68
derrickstolee merged 3 commits intomicrosoft:masterfrom
derrickstolee:loose-objects

Conversation

@derrickstolee
Copy link
Contributor

@derrickstolee derrickstolee commented Aug 19, 2019

The LooseObjectStepTests have been flaky. Try to make them more stable (and faster) using the following steps:

  1. Switch to EnlistmentPerFixture to reduce re-cloning times.
  2. Manually fix the order of the test cases, to avoid order problems causing changes in behavior.
  3. When moving temp packs, check for existence before moving so we can delete instead of renaming.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
@derrickstolee derrickstolee changed the title [WIP] Fix LooseObjectStepTests Fix LooseObjectStepTests Aug 19, 2019
@derrickstolee derrickstolee marked this pull request as ready for review August 19, 2019 13:23
@derrickstolee derrickstolee requested a review from jrbriggs August 19, 2019 13:23
@derrickstolee derrickstolee merged commit 75b3d05 into microsoft:master Aug 19, 2019
derrickstolee added a commit that referenced this pull request Aug 27, 2019
Resolves #77.

Update the functional tests to initialize a sparse enlistment with `scalar sparse --add-stdin` and to test lots of Git commands in that mode versus a vanilla Git repo. Uses the SparseMode checks from microsoft/vfsforgit to verify the contents _inside the cone_ match, but ignores all changes outside the cone. 

This took a lot longer than anticipated. Here are a few things that happened along the way:

* The untracked cache doesn't work correctly on Windows. The functional tests were failing due to quickly running status after every call. This _was_ working correctly on Mac, so maybe we re-enable it on a platform-specific basis later. Reverts #86 until we can revisit.

* The clone verb was causing problems. This is due to some timing concerns, mostly: VFS for Git needs a checkout to construct an index before mounting, but we can't checkout before mounting. Since the sparse verb doesn't prefetch before checkout (it doesn't need _everything_, but needs _some_ things), we needed to change this order. However, the `CloneVerb` code is very convoluted. It required a lot of refactoring to split out that checkout code. Hopefully the new code is cleaner and easier to modify.

* The input for the cone matches is slightly different for Git: we need `/` as the path separator, but the logic for interpreting those paths in the test code uses the platform-specific separator.

* The parallel test scripts were causing new issues in the `LooseObjectStepTests`. Turns out that in #68, I messed up the base constructor parameters and didn't give that enlistment a local object cache. That meant that other clones had prefetches and loose object downloads causing different numbers in these tests. That's fixed.

* `CloneWithDefaultLocalCacheLocation()` was failing on the build machine but not on my laptop. The error appeared to be due to failing to register the mount with the service. Turns out, this test used to use the `--no-mount` option, but that was removed in #80. Oops! Maybe we'll put that back as an `--internal_use_only` parameter. OR we can figure out why the service isn't running during that test.
@derrickstolee derrickstolee deleted the loose-objects branch November 18, 2019 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants