From 61e8aa2b8656b4bfd6f8233449ea390ab09f2e40 Mon Sep 17 00:00:00 2001 From: Claw Date: Fri, 6 Mar 2026 17:15:34 +0000 Subject: [PATCH] azure-pipelines: add nightly scheduled run for flakiness detection Add a nightly scheduled trigger on master so test analytics accumulates clean data points independent of PR activity. Key details: - Runs at midnight UTC every day on master - always: true ensures the run fires even with no new commits, giving a consistent stream of data regardless of merge activity - RUN_TYPE variable tags test run titles as 'Nightly' vs 'CI' so scheduled and PR/push results can be filtered separately in the Azure DevOps test analytics dashboard Without regular master runs, flaky tests at 5-10% failure rates can go undetected for days. A nightly cadence gives 30 clean data points per month, sufficient to surface tests failing >10% of the time. Signed-off-by: Dawei Huang --- azure-pipelines.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ec18ad566..f02bdd009 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,6 +17,17 @@ pr: - 202??? - 201??? +# Scheduled nightly run on master for flakiness detection. +# always: true ensures the run fires even when there are no new commits, +# giving a consistent stream of data points for test analytics. +schedules: +- cron: "0 0 * * *" + displayName: "Nightly master run" + branches: + include: + - master + always: true + variables: - name: BUILD_BRANCH ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: @@ -25,6 +36,13 @@ variables: value: $(Build.SourceBranchName) - name: UNIT_TEST_FLAG value: 'ENABLE_TRANSLIB_WRITE=y' + # Label used in testRunTitle to distinguish scheduled runs from PR/push runs + # in Azure DevOps test analytics, making it easier to filter for clean signal. + - name: RUN_TYPE + ${{ if eq(variables['Build.Reason'], 'Schedule') }}: + value: 'Nightly' + ${{ else }}: + value: 'CI' resources: repositories: @@ -85,7 +103,7 @@ stages: testResultsFiles: '$(System.DefaultWorkingDirectory)/sonic-gnmi/test-results/junit-pure.xml' failTaskOnFailedTests: true publishRunAttachments: true - testRunTitle: 'Pure Package Tests' + testRunTitle: '$(RUN_TYPE) - Pure Package Tests' - task: PublishCodeCoverageResults@1 displayName: 'Publish Pure Package Coverage' @@ -150,7 +168,7 @@ stages: testResultsFiles: '$(System.DefaultWorkingDirectory)/sonic-gnmi/test-results/junit-memleak-standard.xml' failTaskOnFailedTests: true publishRunAttachments: true - testRunTitle: 'Memory Leak Tests' + testRunTitle: '$(RUN_TYPE) - Memory Leak Tests' # Full integration testing with SONiC dependencies - job: build @@ -234,7 +252,7 @@ stages: $(System.DefaultWorkingDirectory)/sonic-gnmi/test-results/junit-integration-dialout.xml failTaskOnFailedTests: true publishRunAttachments: true - testRunTitle: 'Integration Tests' + testRunTitle: '$(RUN_TYPE) - Integration Tests' - publish: $(Build.ArtifactStagingDirectory)/ artifact: sonic-gnmi