Skip to content

Commit

Permalink
remove restarting logic to rule out confounding issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjectsByJackHe committed Jan 10, 2024
1 parent c1f1687 commit 320ae62
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 41 deletions.
13 changes: 9 additions & 4 deletions scripts/secnetperf-run-test.ps1
Original file line number Diff line number Diff line change
@@ -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 = @"
"@
Expand All @@ -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
Expand Down
74 changes: 37 additions & 37 deletions scripts/secnetperf.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 320ae62

Please sign in to comment.