From e52ea78d09202c2077eeda36b182940335517f42 Mon Sep 17 00:00:00 2001 From: Cory Knox Date: Mon, 3 Jul 2023 08:32:51 -0700 Subject: [PATCH] (tests) Clear HTTP Cache before getting packages --- tests/chocolatey-tests/commands/choco-push.Tests.ps1 | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tests/chocolatey-tests/commands/choco-push.Tests.ps1 b/tests/chocolatey-tests/commands/choco-push.Tests.ps1 index 218ada4d9f..ace34a4e08 100644 --- a/tests/chocolatey-tests/commands/choco-push.Tests.ps1 +++ b/tests/chocolatey-tests/commands/choco-push.Tests.ps1 @@ -160,7 +160,7 @@ Describe 'choco push nuget <_> repository' -Tag Chocolatey, PushCommand -Skip:($ } $Output = Invoke-Choco push $PackagePath --source $RepositoryToUse$RepositoryEndpoint @KeyParameter - + Invoke-Choco cache remove $VerifyPackagesSplat = @( "--pre" "--source" @@ -172,15 +172,7 @@ Describe 'choco push nuget <_> repository' -Tag Chocolatey, PushCommand -Skip:($ "--version" "$VersionUnderTest-$AddedVersion" ) - - # Nexus can take a moment to index the package, but we want to validate that it was successfully pushed - $Timer = [System.Diagnostics.Stopwatch]::StartNew() - while ($Timer.Elapsed.TotalSeconds -lt 300 -and -not ( - $Packages = (Invoke-Choco find $PackageUnderTest @VerifyPackagesSplat --Limit-Output).Lines | ConvertFrom-ChocolateyOutput -Command List - )) { - Write-Verbose "$($PackageUnderTest) was not found on $($RepositoryToUse)$($RepositoryEndpoint). Waiting for 5 seconds before trying again." - Start-Sleep -Seconds 5 - } + $Packages = (Invoke-Choco find $PackageUnderTest @VerifyPackagesSplat --Limit-Output).Lines | ConvertFrom-ChocolateyOutput -Command List } AfterAll {