From 6ac9dd582357aab2b2935ee99438eba24f34c88e Mon Sep 17 00:00:00 2001 From: Gaurav Sharma <223556219+Copilot@users.noreply.github.com> Date: Wed, 19 Aug 2026 13:19:01 +0530 Subject: [PATCH] CHORE: Flaky Setup - Gate benchmark and baseline steps on job success the AdventureWorks restore, baseline download, baseline prep and benchmark steps only checked which SQL version the leg was running, never whether anything upstream still worked. an explicit condition replaces the implicit succeeded() rather than adding to it, so these kept running after SQL Server setup had already failed. build 167929 spent 20.2 minutes benchmarking against a database that did not exist on a job that was already dead. each condition now starts with succeeded(), matching what the publish-baseline step already did. applies to the windows and macos legs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/pr-validation-pipeline.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/eng/pipelines/pr-validation-pipeline.yml b/eng/pipelines/pr-validation-pipeline.yml index 47e68cf3..1a9474bc 100644 --- a/eng/pipelines/pr-validation-pipeline.yml +++ b/eng/pipelines/pr-validation-pipeline.yml @@ -292,7 +292,7 @@ jobs: exit 1 } displayName: 'Download and restore AdventureWorks2022 database' - condition: or(eq(variables['sqlVersion'], 'SQL2022'), eq(variables['sqlVersion'], 'SQL2025')) + condition: and(succeeded(), or(eq(variables['sqlVersion'], 'SQL2022'), eq(variables['sqlVersion'], 'SQL2025'))) env: DB_PASSWORD: $(DB_PASSWORD) @@ -307,7 +307,7 @@ jobs: artifact: 'perf-baseline-$(sqlVersion)' path: $(Build.SourcesDirectory) displayName: 'Download baseline from main' - condition: and(ne(variables['Build.SourceBranch'], 'refs/heads/main'), or(eq(variables['sqlVersion'], 'SQL2022'), eq(variables['sqlVersion'], 'SQL2025'))) + condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/main'), or(eq(variables['sqlVersion'], 'SQL2022'), eq(variables['sqlVersion'], 'SQL2025'))) continueOnError: true # Rename downloaded baseline so the script finds it (artifact may be in a subfolder) @@ -320,7 +320,7 @@ jobs: Write-Host "No baseline file downloaded (first run or artifact missing)" } displayName: 'Prepare baseline file' - condition: and(ne(variables['Build.SourceBranch'], 'refs/heads/main'), or(eq(variables['sqlVersion'], 'SQL2022'), eq(variables['sqlVersion'], 'SQL2025'))) + condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/main'), or(eq(variables['sqlVersion'], 'SQL2022'), eq(variables['sqlVersion'], 'SQL2025'))) continueOnError: true # Run performance benchmarks on SQL Server 2022 @@ -412,7 +412,7 @@ jobs: Write-Host "`nRunning performance benchmarks..." python benchmarks/perf-benchmarking.py --baseline benchmark_baseline.json --json benchmark_results.json displayName: 'Run performance benchmarks on SQL Server 2022/2025' - condition: or(eq(variables['sqlVersion'], 'SQL2022'), eq(variables['sqlVersion'], 'SQL2025')) + condition: and(succeeded(), or(eq(variables['sqlVersion'], 'SQL2022'), eq(variables['sqlVersion'], 'SQL2025'))) continueOnError: true env: DB_CONNECTION_STRING: 'Server=localhost;Database=AdventureWorks2022;Uid=sa;Pwd=$(DB_PASSWORD);TrustServerCertificate=yes' @@ -656,7 +656,7 @@ jobs: rm -f /tmp/AdventureWorks2022.bak docker exec sqlserver rm -f /tmp/AdventureWorks2022.bak || true displayName: 'Download and restore AdventureWorks2022 database on macOS' - condition: or(eq(variables['sqlVersion'], 'SQL2022'), eq(variables['sqlVersion'], 'SQL2025')) + condition: and(succeeded(), or(eq(variables['sqlVersion'], 'SQL2022'), eq(variables['sqlVersion'], 'SQL2025'))) continueOnError: true env: DB_PASSWORD: $(DB_PASSWORD) @@ -672,7 +672,7 @@ jobs: artifact: 'perf-baseline-macOS-$(sqlVersion)' path: $(Build.SourcesDirectory) displayName: 'Download macOS baseline from main' - condition: and(ne(variables['Build.SourceBranch'], 'refs/heads/main'), or(eq(variables['sqlVersion'], 'SQL2022'), eq(variables['sqlVersion'], 'SQL2025'))) + condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/main'), or(eq(variables['sqlVersion'], 'SQL2022'), eq(variables['sqlVersion'], 'SQL2025'))) continueOnError: true - script: | @@ -684,7 +684,7 @@ jobs: echo "No baseline file downloaded (first run or artifact missing)" fi displayName: 'Prepare macOS baseline file' - condition: and(ne(variables['Build.SourceBranch'], 'refs/heads/main'), or(eq(variables['sqlVersion'], 'SQL2022'), eq(variables['sqlVersion'], 'SQL2025'))) + condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/main'), or(eq(variables['sqlVersion'], 'SQL2022'), eq(variables['sqlVersion'], 'SQL2025'))) continueOnError: true # Run performance benchmarks on macOS @@ -698,7 +698,7 @@ jobs: echo "Running performance benchmarks..." python benchmarks/perf-benchmarking.py --baseline benchmark_baseline.json --json benchmark_results.json displayName: 'Run performance benchmarks on macOS $(sqlVersion)' - condition: or(eq(variables['sqlVersion'], 'SQL2022'), eq(variables['sqlVersion'], 'SQL2025')) + condition: and(succeeded(), or(eq(variables['sqlVersion'], 'SQL2022'), eq(variables['sqlVersion'], 'SQL2025'))) timeoutInMinutes: 20 continueOnError: true env: