Skip to content

Commit 6b76e93

Browse files
authored
[devops] Clean up temporary files on Windows before running remote tests. (#22221)
This is an attempt to fix a random connection issue: > Integrity check failed between source and target content. Source path: D:\AzDO\_work\16\s\xamarin-macios\tests\dotnet\Windows\bin\dotnet\packs\Microsoft.iOS.Windows.Sdk.net9.0_18.2\18.2.9451-ci.dev-rolf-xml-docs-1\tools\msbuild\iOS\Broker.zip, Target path: /Users/builder/Library/Caches/Xamarin/XMA/Agents/Broker/3.0.0.13 Ref: https://teams.microsoft.com/l/message/19:[email protected]/1740052447890?tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&groupId=0056f60b-301f-43ac-bbcf-f356d3c42c92&parentMessageId=1740052447890&teamName=VS%20Client%20Experiences&channelName=MaciOS%20%F0%9F%8D%8E&createdTime=1740052447890
1 parent be2ec4d commit 6b76e93

File tree

1 file changed

+13
-0
lines changed
  • tools/devops/automation/templates/windows

1 file changed

+13
-0
lines changed

tools/devops/automation/templates/windows/build.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,19 @@ steps:
153153
}
154154
displayName: "Verify ssh connection"
155155

156+
- pwsh: |
157+
$remoteTmpPath = "${Env:LOCALAPPDATA}\Temp\Xamarin\XMA\Remote"
158+
Write-Host "Remote tmp path: $remoteTmpPath"
159+
# let's see what's there
160+
if (Test-Path -Path $remoteTmpPath) {
161+
Get-ChildItem -Path $remoteTmpPath
162+
Get-ChildItem -Path $remoteTmpPath | Format-Table | Out-String | Write-Host
163+
Remove-Item -Recurse -Force $remoteTmpPath
164+
} else {
165+
Write-Host "Remote tmp path doesn't exist!"
166+
}
167+
displayName: "Cleanup temporary files"
168+
156169
# This task fixes errors such as these:
157170
# error MSB4242: SDK Resolver Failure: "The SDK resolver "NuGetSdkResolver" failed while attempting to resolve the SDK "Microsoft.Build.NoTargets/3.3.0".
158171
# Exception: "NuGet.Packaging.Core.PackagingException: Unable to find fallback package folder 'D:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages'.

0 commit comments

Comments
 (0)