Disable APIPA Interface for Loopback Test Perf
@@ -244,6 +244,17 @@ function Run-Loopback-Test() {
$LoopbackOutputDir = Join-Path $OutputDir "loopback"
New-Item $LoopbackOutputDir -ItemType Directory -Force | Out-Null
+ $apipaInterfaces = $null
+ if ($IsWindows) {
+ $apipaAddr = Get-NetIPAddress 169.254.*
+ if ($null -ne $apipaAddr) {
+ # Disable all the APIPA interfaces for URO perf.
+ Write-Debug "Temporarily disabling APIPA interfaces"
+ $apipaInterfaces = (Get-NetAdapter -InterfaceIndex $apipaAddr.InterfaceIndex) | where {$_.AdminStatus -eq "Up"}
+ $apipaInterfaces | Disable-NetAdapter -Confirm:$false
+ }
+ }
+
$ServerDir = $Artifacts
if ($PGO) {
# PGO needs the server and client executing out of separate directories.
@@ -259,12 +270,14 @@ function Run-Loopback-Test() {
}
}
+ $allRunsResults = @()
+ $serverOutput = $null
+ try {
+
# Start the server.
$proc = Start-Background-Executable -File (Join-Path $ServerDir $QuicPing) -Arguments $ServerArgs
Start-Sleep 4
- $allRunsResults = @()
- $serverOutput = $null
try {
1..$Runs | ForEach-Object {
$clientOutput = Run-Foreground-Executable -File (Join-Path $Artifacts $QuicPing) -Arguments $ClientArgs
@@ -291,6 +304,8 @@ function Run-Loopback-Test() {
throw
}
+ } finally {
+
if ($Record) {
# Stop the performance collection.
if ($IsWindows) {
@@ -306,6 +321,13 @@ function Run-Loopback-Test() {
Remove-Item $ServerDir -Recurse -Force | Out-Null
}
+ if ($null -ne $apipaInterfaces) {
+ # Re-enable the interfaces we disabled earlier.
+ Write-Debug "Re-enabling APIPA interfaces"
+ $apipaInterfaces | Enable-NetAdapter
+ }
+ }
+
# Print current and latest master results to console.
$MedianCurrentResult = Median-Test-Results -FullResults $allRunsResults
$fullLastResult = Get-Latest-Test-Results -Platform $Platform -Test "loopback"
