Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Storage] Stress tests in pipeline? #21030

Merged
merged 23 commits into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ public static void runTests(PerfStressTest<?>[] tests, boolean sync, int paralle
System.out.println("=== Results ===");

int totalOperations = getCompletedOperations();
if (totalOperations == 0) {
throw new IllegalStateException("Zero operations has been completed");
}
double operationsPerSecond = getOperationsPerSecond();
double secondsPerOperation = 1 / operationsPerSecond;
double weightedAverageSeconds = totalOperations / operationsPerSecond;
Expand Down Expand Up @@ -249,7 +252,7 @@ private static Mono<Void> runLoopAsync(PerfStressTest<?> test, int index, long e
completedOperations[index]++;
lastCompletionNanoTimes[index] = System.nanoTime() - startNanoTime;
})
.take(Duration.ofNanos(endNanoTime - startNanoTime))
.takeWhile(i -> System.nanoTime() < endNanoTime)
.then();
}

Expand Down
23 changes: 23 additions & 0 deletions sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
$JavaPath = Join-Path -Path $Env:JAVA_HOME -ChildPath "bin" | Join-Path -ChildPath "java"
$TargetDirPath = Join-Path -Path $PSScriptRoot -ChildPath "target"
$PerfJarPath = Get-ChildItem -Path (Join-Path -Path $TargetDirPath -ChildPath "*") -Include azure-storage-perf-*-jar-with-dependencies.jar -File

Invoke-Expression "& '$JavaPath' -version"

function Run-Scenario {
param (
[Parameter(Mandatory=$true, Position=0)]
[string] $HeapSize,
[Parameter(Mandatory=$true, Position=1)]
[string] $Scenario
)
Write-Host "Executing '$Scenario' with '$HeapSize' heap"
Invoke-Expression "& '$JavaPath' -Xms$HeapSize -Xmx$HeapSize -jar '$PerfJarPath' $Scenario"
if ($LASTEXITCODE -ne 0) {
Write-Host "Scenario failed, exiting"
exit 1
}
}

Run-Scenario "700m" "uploadoutputstream --warmup 0 --duration 1 --size 1048576000 --sync"
Run-Scenario "700m" "uploadblob --warmup 0 --duration 1 --size 1048576000"
Comment on lines +22 to +23
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for some reason going below 700m doesn't work on Java 11. Java 8 is less greedy...

19 changes: 18 additions & 1 deletion sdk/storage/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ stages:
- name: azure-storage-queue
groupId: com.azure
safeName: azurestoragequeue
AdditionalModules:
- name: perf-test-core
groupId: com.azure
- name: azure-storage-perf
groupId: com.azure
TestMode: 'LIVE'
TimeoutInMinutes: 240
TimeoutInMinutes: 60
Location: canadacentral
Clouds: 'Preview'
TestStepMavenInputs:
Expand All @@ -55,6 +60,18 @@ stages:
Path: sdk/storage/platform-matrix.json
Selection: sparse
GenerateVMJobs: true
PostSteps:
- task: PowerShell@2
displayName: 'Run Stress Scenarios'
inputs:
targetType: 'filePath'
filePath: sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1
env:
${{ if eq(variables['JavaTestVersion'], '1.11') }}:
JAVA_HOME: $(JAVA_HOME_11_X64)
${{ if eq(variables['JavaTestVersion'], '1.8') }}:
JAVA_HOME: $(JAVA_HOME_8_X64)
STORAGE_CONNECTION_STRING: $(PRIMARY_STORAGE_CONNECTION_STRING)
EnvVars:
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
Expand Down