Permalink
Browse files

Ignore delete exceptions when cleaning up sites in tests

There are often DLLs that are harmless but locked, so not ignoring breaks things.
  • Loading branch information...
1 parent 0968f3d commit 4b8242e531dcb0b76f7cb96042700e5b03cffda4 @davidebbo davidebbo committed Jan 19, 2013
Showing with 6 additions and 3 deletions.
  1. +5 −2 Kudu.Client/SourceControl/RemoteRepositoryManager.cs
  2. +1 −1 Kudu.TestHarness/ApplicationManager.cs
View
7 Kudu.Client/SourceControl/RemoteRepositoryManager.cs
@@ -19,9 +19,12 @@ public Task<RepositoryInfo> GetRepositoryInfo()
return Client.GetJsonAsync<RepositoryInfo>("info");
}
- public Task Delete(bool deleteWebRoot = false)
+ public Task Delete(bool deleteWebRoot = false, bool ignoreErrors = false)
{
- return Client.DeleteSafeAsync(deleteWebRoot ? "?deleteWebRoot=1" : String.Empty);
+ return Client.DeleteSafeAsync(
+ String.Format("?deleteWebRoot={0}&ignoreErrors={1}",
+ deleteWebRoot ? "1" : "0",
+ ignoreErrors ? "1" : "0"));
}
}
}
View
2 Kudu.TestHarness/ApplicationManager.cs
@@ -118,7 +118,7 @@ public static void Run(string testName, Action<ApplicationManager> action)
if (KuduUtils.ReuseSameSiteForAllTests)
{
// In site reuse mode, clean out the existing site so we start clean
- appManager.RepositoryManager.Delete(deleteWebRoot: true).Wait();
+ appManager.RepositoryManager.Delete(deleteWebRoot: true, ignoreErrors: true).Wait();
// Make sure we start with the correct default file as some tests expect it
appManager.VfsWebRootManager.WriteAllText("index.html", "<h1>This web site has been successfully created</h1>");

0 comments on commit 4b8242e

Please sign in to comment.