diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2022-09-15 12:17:47 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2022-09-15 14:14:04 -0500 |
| commit | a470bbc209dff298dbf86a29393d6a2a8b768dc8 (patch) | |
| tree | 7592437afb9bee4751d2e3393c655876b7c62077 /src/test | |
| parent | 95e8b1be902cce3b5a394066a62e0c32d0688261 (diff) | |
| download | wix-a470bbc209dff298dbf86a29393d6a2a8b768dc8.tar.gz wix-a470bbc209dff298dbf86a29393d6a2a8b768dc8.tar.bz2 wix-a470bbc209dff298dbf86a29393d6a2a8b768dc8.zip | |
Ignore cache bundle failure if it already exists in the package cache.
Fixes 6848
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs index e5e3259f..afc3fc10 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs | |||
| @@ -204,6 +204,35 @@ namespace WixToolsetTest.BurnE2E | |||
| 204 | } | 204 | } |
| 205 | 205 | ||
| 206 | [RuntimeFact] | 206 | [RuntimeFact] |
| 207 | public void CanHandleCachedBundleInPackageCacheInUse() | ||
| 208 | { | ||
| 209 | var packageA = this.CreatePackageInstaller("PackageA"); | ||
| 210 | var packageB = this.CreatePackageInstaller("PackageB"); | ||
| 211 | var bundleA = this.CreateBundleInstaller("BundleA"); | ||
| 212 | |||
| 213 | bundleA.Install(); | ||
| 214 | |||
| 215 | var registration = bundleA.VerifyRegisteredAndInPackageCache(); | ||
| 216 | var cachedBundlePath = registration.CachePath; | ||
| 217 | |||
| 218 | packageA.VerifyInstalled(true); | ||
| 219 | packageB.VerifyInstalled(true); | ||
| 220 | |||
| 221 | // Lock the bundle file in the package cache. | ||
| 222 | string modifyLogPath; | ||
| 223 | using (FileStream lockTargetFile = new FileStream(cachedBundlePath, FileMode.Open, FileAccess.ReadWrite, FileShare.None)) | ||
| 224 | { | ||
| 225 | modifyLogPath = bundleA.Modify(); | ||
| 226 | } | ||
| 227 | |||
| 228 | bundleA.VerifyRegisteredAndInPackageCache(); | ||
| 229 | packageA.VerifyInstalled(true); | ||
| 230 | packageB.VerifyInstalled(true); | ||
| 231 | |||
| 232 | Assert.True(LogVerifier.MessageInLogFile(modifyLogPath, "w345: Ignoring failure to cache bundle because the file already exists, encountered error: 0x80070020. Continuing...")); | ||
| 233 | } | ||
| 234 | |||
| 235 | [RuntimeFact] | ||
| 207 | public void CanGetEngineWorkingDirectoryFromCommandLine() | 236 | public void CanGetEngineWorkingDirectoryFromCommandLine() |
| 208 | { | 237 | { |
| 209 | var bundleA = this.CreateBundleInstaller("BundleA"); | 238 | var bundleA = this.CreateBundleInstaller("BundleA"); |
| @@ -215,7 +244,7 @@ namespace WixToolsetTest.BurnE2E | |||
| 215 | { | 244 | { |
| 216 | var baseTempPath = dfs.GetFolder(true); | 245 | var baseTempPath = dfs.GetFolder(true); |
| 217 | var logPath = bundleA.Install(0, $"-burn.engine.working.directory=\"{baseTempPath}\""); | 246 | var logPath = bundleA.Install(0, $"-burn.engine.working.directory=\"{baseTempPath}\""); |
| 218 | LogVerifier.MessageInLogFileRegex(logPath, $"Burn x86 v4.*, Windows v.* \\(Build .*: Service Pack .*\\), path: {baseTempPath.Replace("\\", "\\\\")}\\\\.*\\\\.cr\\\\BundleA.exe"); | 247 | Assert.True(LogVerifier.MessageInLogFileRegex(logPath, $"Burn x86 v4.*, Windows v.* \\(Build .*: Service Pack .*\\), path: {baseTempPath.Replace("\\", "\\\\")}\\\\.*\\\\.cr\\\\BundleA.exe")); |
| 219 | } | 248 | } |
| 220 | } | 249 | } |
| 221 | 250 | ||
| @@ -251,7 +280,7 @@ namespace WixToolsetTest.BurnE2E | |||
| 251 | } | 280 | } |
| 252 | 281 | ||
| 253 | var logPath = bundleA.Install(); | 282 | var logPath = bundleA.Install(); |
| 254 | LogVerifier.MessageInLogFileRegex(logPath, $"Burn x86 v4.*, Windows v.* \\(Build .*: Service Pack .*\\), path: {baseTempPath.Replace("\\", "\\\\")}\\\\.*\\\\.cr\\\\BundleA.exe"); | 283 | Assert.True(LogVerifier.MessageInLogFileRegex(logPath, $"Burn x86 v4.*, Windows v.* \\(Build .*: Service Pack .*\\), path: {baseTempPath.Replace("\\", "\\\\")}\\\\.*\\\\.cr\\\\BundleA.exe")); |
| 255 | } | 284 | } |
| 256 | } | 285 | } |
| 257 | finally | 286 | finally |
