microsoft / microsoft/VFSForGit

Be consistent with cleaning up functional tests on Windows and macOS

Open
#836 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: test-reliability
Dominant language
C#
Stars
6.1k
Forks
474
Avg merge
2d 4h
Merged PRs (30d)
8

Description

We recently hit an issue where we had failing tests on Windows due to a second remote being used as the repo under test. This creates a separate .gvfsCache folder and mapping.dat entry.

On Windows, we don't clean up the Functional Tests folder between runs and since a second URL was used, tests that ensure we only have one .gvfsCache fail:

Errors, Failures and Warnings

1) Failed : GVFS.FunctionalTests.Tests.EnlistmentPerFixture.PrefetchVerbTests.PrefetchCleansUpStalePrefetchLock()
  C:\Repos\GVFSFunctionalTests\enlistment\..\.gvfsCache is expected to have only one folder. Actual folders: C:\Repos\GVFSFunctionalTests\.gvfsCache\29988cba39514a77bf35068f41600402,C:\Repos\GVFSFunctionalTests\.gvfsCache\b810a5d8b978423bb9fe3aa140499e0e
  Expected: 1
  But was:  2
   at GVFS.Tests.Should.ValueShouldExtensions.ShouldEqual[T](T actualValue, T expectedValue, String message) in C:\agent\_work\11\s\GVFS\GVFS.Tests\Should\ValueShouldExtensions.cs:line 34
   at GVFS.FunctionalTests.Tools.GVFSFunctionalTestEnlistment.GetObjectRoot(FileSystemRunner fileSystem) in C:\agent\_work\11\s\GVFS\GVFS.FunctionalTests\Tools\GVFSFunctionalTestEnlistment.cs:line 132
   at GVFS.FunctionalTests.Tests.EnlistmentPerFixture.PrefetchVerbTests.PostFetchStepShouldComplete() in C:\agent\_work\11\s\GVFS\GVFS.FunctionalTests\Tests\EnlistmentPerFixture\PrefetchVerbTests.cs:line 227
   at GVFS.FunctionalTests.Tests.EnlistmentPerFixture.PrefetchVerbTests.PrefetchCleansUpStalePrefetchLock() in C:\agent\_work\11\s\GVFS\GVFS.FunctionalTests\Tests\EnlistmentPerFixture\PrefetchVerbTests.cs:line 122

2) Failed : GVFS.FunctionalTests.Tests.EnlistmentPerFixture.PrefetchVerbTests.PrefetchCleansUpPackDir()
  C:\Repos\GVFSFunctionalTests\enlistment\..\.gvfsCache is expected to have only one folder. Actual folders: C:\Repos\GVFSFunctionalTests\.gvfsCache\29988cba39514a77bf35068f41600402,C:\Repos\GVFSFunctionalTests\.gvfsCache\b810a5d8b978423bb9fe3aa140499e0e
  Expected: 1
  But was:  2
   at GVFS.Tests.Should.ValueShouldExtensions.ShouldEqual[T](T actualValue, T expectedValue, String message) in C:\agent\_work\11\s\GVFS\GVFS.Tests\Should\ValueShouldExtensions.cs:line 34
   at GVFS.FunctionalTests.Tools.GVFSFunctionalTestEnlistment.GetObjectRoot(FileSystemRunner fileSystem) in C:\agent\_work\11\s\GVFS\GVFS.FunctionalTests\Tools\GVFSFunctionalTestEnlistment.cs:line 132
   at GVFS.FunctionalTests.Tools.GVFSFunctionalTestEnlistment.GetPackRoot(FileSystemRunner fileSystem) in C:\agent\_work\11\s\GVFS\GVFS.FunctionalTests\Tools\GVFSFunctionalTestEnlistment.cs:line 141
   at GVFS.FunctionalTests.Tests.EnlistmentPerFixture.PrefetchVerbTests.PrefetchCleansUpPackDir() in C:\agent\_work\11\s\GVFS\GVFS.FunctionalTests\Tests\EnlistmentPerFixture\PrefetchVerbTests.cs:line 144

On macOS, we delete that folder between runs due to issues we encountered when first standing up the Functional Tests. Recent work on stress testing the kext by running the Functional Tests shows that we don't need to delete that folder between runs.

We should be consistent between platforms; either we delete the FunctionalTests folder on both or not.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with GVFSFunctionalTestEnlistment.cs and the failing PrefetchVerbTests.cs cases to understand how the Functional Tests folder and .gvfsCache are handled. Compare the Windows and macOS cleanup behavior, then run the affected functional tests on both platforms. Done means both platforms consistently follow the chosen cleanup policy without stale cache failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
operating-systems, testing-qa
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.