From 320ae62de4bbe3edf6e674dc155532e1724b20ae Mon Sep 17 00:00:00 2001 From: Jack He Date: Wed, 10 Jan 2024 14:04:36 -0800 Subject: [PATCH] remove restarting logic to rule out confounding issues --- scripts/secnetperf-run-test.ps1 | 13 ++++-- scripts/secnetperf.ps1 | 74 ++++++++++++++++----------------- 2 files changed, 46 insertions(+), 41 deletions(-) diff --git a/scripts/secnetperf-run-test.ps1 b/scripts/secnetperf-run-test.ps1 index 64cd73eae8..152438c174 100644 --- a/scripts/secnetperf-run-test.ps1 +++ b/scripts/secnetperf-run-test.ps1 @@ -1,6 +1,11 @@ +# Write a GitHub error message to the console. +function Write-GHError($msg) { + Write-Host "::error::$msg" +} + function Run-Secnetperf($testIds, $commands, $exe, $json) { - Write-Host "Running tests" + Write-Host "Running Secnetperf tests..." $SQL = @" "@ @@ -10,21 +15,21 @@ function Run-Secnetperf($testIds, $commands, $exe, $json) { for ($tcp = 0; $tcp -lt 2; $tcp++) { for ($try = 0; $try -lt 3; $try++) { $command = "$exe -target:netperf-peer $($commands[$i]) -tcp:$tcp -trimout" - Write-Output "Running test: $command" + Write-Host "Running test: $command" try { $rawOutput = Invoke-Expression $command } catch { Write-GHError "Failed to run test: $($commands[$i])" Write-GHError $_ - $encounterFailures = $true + $script:encounterFailures = $true continue } if ($rawOutput.Contains("Error")) { $rawOutput = $rawOutput.Substring(7) # Skip over the 'Error: ' prefix Write-GHError $rawOutput - $encounterFailures = $true + $script:encounterFailures = $true continue } Write-Host $rawOutput diff --git a/scripts/secnetperf.ps1 b/scripts/secnetperf.ps1 index a3c962c451..a55db82d54 100644 --- a/scripts/secnetperf.ps1 +++ b/scripts/secnetperf.ps1 @@ -228,43 +228,43 @@ $lowlat = @( $SQL += Run-Secnetperf $maxtputIds $maxtput $exe $json # Start and restart the SecNetPerf server without maxtput. -Write-Output "Restarting server without maxtput..." - -if ($isWindows) { - Invoke-Command -Session $Session -ScriptBlock { - Get-Process | Where-Object { $_.Name -eq "secnetperf.exe" } | Stop-Process - } -} else { - Invoke-Command -Session $Session -ScriptBlock { - Get-Process | Where-Object { $_.Name -eq "secnetperf" } | Stop-Process - } -} - -Start-Sleep -Seconds 5 - -if ($isWindows) { - $Job = Invoke-Command -Session $Session -ScriptBlock { - C:\_work\quic\artifacts\bin\windows\x64_Release_schannel\secnetperf.exe - } -AsJob -} else { - $Job = Invoke-Command -Session $Session -ScriptBlock { - $env:LD_LIBRARY_PATH = "${env:LD_LIBRARY_PATH}:/home/secnetperf/_work/artifacts/bin/linux/x64_Release_openssl/" - chmod +x /home/secnetperf/_work/artifacts/bin/linux/x64_Release_openssl/secnetperf - /home/secnetperf/_work/artifacts/bin/linux/x64_Release_openssl/secnetperf - } -AsJob -} - -# Wait for the server to start. -Write-Output "Waiting for server to start..." -$ReadyToStart = Wait-ForRemoteReady -Job $Job -Matcher "Started!" -if (!$ReadyToStart) { - Stop-Job -Job $RemoteJob - $RemoteResult = Receive-Job -Job $Job -ErrorAction $ErrorAction - $RemoteResult = $RemoteResult -join "`n" - Write-GHError "Server failed to start! Output:" - Write-Output $RemoteResult - throw "Server failed to start!" -} +# Write-Output "Restarting server without maxtput..." + +# if ($isWindows) { +# Invoke-Command -Session $Session -ScriptBlock { +# Get-Process | Where-Object { $_.Name -eq "secnetperf.exe" } | Stop-Process +# } +# } else { +# Invoke-Command -Session $Session -ScriptBlock { +# Get-Process | Where-Object { $_.Name -eq "secnetperf" } | Stop-Process +# } +# } + +# Start-Sleep -Seconds 5 + +# if ($isWindows) { +# $Job = Invoke-Command -Session $Session -ScriptBlock { +# C:\_work\quic\artifacts\bin\windows\x64_Release_schannel\secnetperf.exe +# } -AsJob +# } else { +# $Job = Invoke-Command -Session $Session -ScriptBlock { +# $env:LD_LIBRARY_PATH = "${env:LD_LIBRARY_PATH}:/home/secnetperf/_work/artifacts/bin/linux/x64_Release_openssl/" +# chmod +x /home/secnetperf/_work/artifacts/bin/linux/x64_Release_openssl/secnetperf +# /home/secnetperf/_work/artifacts/bin/linux/x64_Release_openssl/secnetperf +# } -AsJob +# } + +# # Wait for the server to start. +# Write-Output "Waiting for server to start..." +# $ReadyToStart = Wait-ForRemoteReady -Job $Job -Matcher "Started!" +# if (!$ReadyToStart) { +# Stop-Job -Job $RemoteJob +# $RemoteResult = Receive-Job -Job $Job -ErrorAction $ErrorAction +# $RemoteResult = $RemoteResult -join "`n" +# Write-GHError "Server failed to start! Output:" +# Write-Output $RemoteResult +# throw "Server failed to start!" +# } $SQL += Run-Secnetperf $lowlatIds $lowlat $exe $json