diff --git a/backend/Testing/Services/Utils.cs b/backend/Testing/Services/Utils.cs index 76cf059cdc..7678688203 100644 --- a/backend/Testing/Services/Utils.cs +++ b/backend/Testing/Services/Utils.cs @@ -61,6 +61,7 @@ ... on DbError { } } """); + await apiTester.InvalidateDirCache(config.Code); // Ensure newly-created project is available right away return new LexboxProject(apiTester, config.Id); } @@ -84,11 +85,6 @@ public static async Task WaitForHgRefreshIntervalAsync() await Task.Delay(TestingEnvironmentVariables.HgRefreshInterval); } - public static async Task WaitForLexboxMetadataUpdateAsync() - { - await Task.Delay(3000); - } - private static string GetNewProjectDir(string projectCode, [CallerMemberName] string projectName = "") { diff --git a/backend/Testing/SyncReverseProxy/SendReceiveServiceTests.cs b/backend/Testing/SyncReverseProxy/SendReceiveServiceTests.cs index c0a5ad2309..0ae4b118e8 100644 --- a/backend/Testing/SyncReverseProxy/SendReceiveServiceTests.cs +++ b/backend/Testing/SyncReverseProxy/SendReceiveServiceTests.cs @@ -81,13 +81,11 @@ public async Task ModifyProjectData(HgProtocol protocol) var projectConfig = _srFixture.InitLocalFlexProjectWithRepo(); await using var project = await RegisterProjectInLexBox(projectConfig, _adminApiTester); - await WaitForHgRefreshIntervalAsync(); - // Push the project to the server var sendReceiveParams = new SendReceiveParams(protocol, projectConfig); _sendReceiveService.SendReceiveProject(sendReceiveParams, AdminAuth); - await WaitForLexboxMetadataUpdateAsync(); + await _adminApiTester.InvalidateDirCache(projectConfig.Code); // Verify pushed and store last commit var lastCommitDate = await _adminApiTester.GetProjectLastCommit(projectConfig.Code); @@ -101,7 +99,7 @@ public async Task ModifyProjectData(HgProtocol protocol) // Push changes _sendReceiveService.SendReceiveProject(sendReceiveParams, AdminAuth, "Modify project data automated test"); - await WaitForLexboxMetadataUpdateAsync(); + await _adminApiTester.InvalidateDirCache(projectConfig.Code); // Verify the push updated the last commit date var lastCommitDateAfter = await _adminApiTester.GetProjectLastCommit(projectConfig.Code); @@ -117,8 +115,6 @@ public async Task SendReceiveAfterProjectReset(HgProtocol protocol) var projectConfig = _srFixture.InitLocalFlexProjectWithRepo(protocol, "SR_AfterReset"); await using var project = await RegisterProjectInLexBox(projectConfig, _adminApiTester); - await _adminApiTester.InvalidateDirCache(projectConfig.Code); - var sendReceiveParams = new SendReceiveParams(protocol, projectConfig); var srResult = _sendReceiveService.SendReceiveProject(sendReceiveParams, AdminAuth);