From 6f17e13c5e1e867ec1e101eed3946c4a6e089a29 Mon Sep 17 00:00:00 2001 From: Saeed Noursalehi Date: Thu, 13 Sep 2018 10:20:50 -0700 Subject: [PATCH 1/2] Re-enable all tests that are failing due to auth cache issues --- GVFS/GVFS.FunctionalTests/Categories.cs | 1 - GVFS/GVFS.FunctionalTests/Program.cs | 1 - .../Tests/EnlistmentPerFixture/MultithreadedReadWriteTests.cs | 3 +-- GVFS/GVFS.FunctionalTests/Tests/GitCommands/CheckoutTests.cs | 4 ---- 4 files changed, 1 insertion(+), 8 deletions(-) diff --git a/GVFS/GVFS.FunctionalTests/Categories.cs b/GVFS/GVFS.FunctionalTests/Categories.cs index 181d671ad..3d65d7d6b 100644 --- a/GVFS/GVFS.FunctionalTests/Categories.cs +++ b/GVFS/GVFS.FunctionalTests/Categories.cs @@ -15,7 +15,6 @@ public static class MacTODO // machines but not on the build agents public const string FailsOnBuildAgent = "FailsOnBuildAgent"; public const string NeedsLockHolder = "NeedsDotCoreLockHolder"; - public const string NeedsCachePoisonFix = "NeedsCachePoisonFix"; public const string M2 = "M2_StaticViewGitCommands"; public const string M3 = "M3_AllGitCommands"; public const string M4 = "M4_All"; diff --git a/GVFS/GVFS.FunctionalTests/Program.cs b/GVFS/GVFS.FunctionalTests/Program.cs index a9cf972c0..b467b28d5 100644 --- a/GVFS/GVFS.FunctionalTests/Program.cs +++ b/GVFS/GVFS.FunctionalTests/Program.cs @@ -67,7 +67,6 @@ public static void Main(string[] args) { excludeCategories.Add(Categories.MacTODO.NeedsLockHolder); excludeCategories.Add(Categories.MacTODO.FailsOnBuildAgent); - excludeCategories.Add(Categories.MacTODO.NeedsCachePoisonFix); excludeCategories.Add(Categories.MacTODO.M2); excludeCategories.Add(Categories.MacTODO.M3); excludeCategories.Add(Categories.MacTODO.M4); diff --git a/GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerFixture/MultithreadedReadWriteTests.cs b/GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerFixture/MultithreadedReadWriteTests.cs index 9846642af..df916dc3c 100644 --- a/GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerFixture/MultithreadedReadWriteTests.cs +++ b/GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerFixture/MultithreadedReadWriteTests.cs @@ -14,7 +14,6 @@ namespace GVFS.FunctionalTests.Tests.EnlistmentPerFixture public class MultithreadedReadWriteTests : TestsWithEnlistmentPerFixture { [TestCase, Order(1)] - [Category(Categories.MacTODO.NeedsCachePoisonFix)] public void CanReadVirtualFileInParallel() { // Note: This test MUST go first, or else it needs to ensure that it is reading a unique path compared to the @@ -27,7 +26,7 @@ public void CanReadVirtualFileInParallel() Exception readException = null; - Thread[] threads = new Thread[32]; + Thread[] threads = new Thread[128]; for (int i = 0; i < threads.Length; ++i) { threads[i] = new Thread(() => diff --git a/GVFS/GVFS.FunctionalTests/Tests/GitCommands/CheckoutTests.cs b/GVFS/GVFS.FunctionalTests/Tests/GitCommands/CheckoutTests.cs index 0fb311fc6..a0d801a83 100644 --- a/GVFS/GVFS.FunctionalTests/Tests/GitCommands/CheckoutTests.cs +++ b/GVFS/GVFS.FunctionalTests/Tests/GitCommands/CheckoutTests.cs @@ -88,7 +88,6 @@ private enum NativeFileAccess : uint } [TestCase] - [Category(Categories.MacTODO.NeedsCachePoisonFix)] public void ReadDeepFilesAfterCheckout() { // In commit 8df701986dea0a5e78b742d2eaf9348825b14d35 the CheckoutNewBranchFromStartingPointTest files were not present @@ -104,7 +103,6 @@ public void ReadDeepFilesAfterCheckout() } [TestCase] - [Category(Categories.MacTODO.NeedsCachePoisonFix)] public void CheckoutNewBranchFromStartingPointTest() { // In commit 8df701986dea0a5e78b742d2eaf9348825b14d35 the CheckoutNewBranchFromStartingPointTest files were not present @@ -121,7 +119,6 @@ public void CheckoutNewBranchFromStartingPointTest() } [TestCase] - [Category(Categories.MacTODO.NeedsCachePoisonFix)] public void CheckoutOrhpanBranchFromStartingPointTest() { // In commit 8df701986dea0a5e78b742d2eaf9348825b14d35 the CheckoutOrhpanBranchFromStartingPointTest files were not present @@ -734,7 +731,6 @@ public void DeleteFolderAndChangeBranchToFolderWithDifferentCase() } [TestCase] - [Category(Categories.MacTODO.NeedsCachePoisonFix)] public void SuccessfullyChecksOutDirectoryToFileToDirectory() { // This test switches between two branches and verifies specific transitions occured From 1b5bdb69f6d59e53cee48a2649983af6ea912f89 Mon Sep 17 00:00:00 2001 From: Saeed Noursalehi Date: Thu, 13 Sep 2018 15:32:07 -0700 Subject: [PATCH 2/2] Set the auth cache TTL to 0 when registering a virtualization root --- ProjFS.Mac/PrjFSKext/PrjFSKext/VirtualizationRoots.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ProjFS.Mac/PrjFSKext/PrjFSKext/VirtualizationRoots.cpp b/ProjFS.Mac/PrjFSKext/PrjFSKext/VirtualizationRoots.cpp index d37281361..443a8d30f 100644 --- a/ProjFS.Mac/PrjFSKext/PrjFSKext/VirtualizationRoots.cpp +++ b/ProjFS.Mac/PrjFSKext/PrjFSKext/VirtualizationRoots.cpp @@ -105,7 +105,6 @@ int16_t VirtualizationRoots_LookupVnode(vnode_t vnode, vfs_context_t context) { // TODO: check xattr contents - char path[PrjFSMaxPath] = ""; int pathLength = sizeof(path); vn_getpath(vnode, path, &pathLength); @@ -283,6 +282,12 @@ VirtualizationRootResult VirtualizationRoot_RegisterProviderForPath(PrjFSProvide vnode_put(virtualizationRootVNode); } + if (rootIndex >= 0) + { + VirtualizationRoot* root = &s_virtualizationRoots[rootIndex]; + vfs_setauthcache_ttl(vnode_mount(root->rootVNode), 0); + } + vfs_context_rele(vfsContext); return VirtualizationRootResult { err, rootIndex };