name: Connection Stability Test # Long-haul connection stability soak (Category=ConnectionStability in # Opc.Ua.Sessions.Tests; the tests are [Explicit] and only run here). # # Opt-in: nightly (90 minutes), manual (choose the duration), and pull requests # labelled 'soak' (30 minutes). It is not a required check. Adding the label # starts a run; every later push to the labelled pull request starts a new one # and cancels the run in progress. on: schedule: # Run nightly at 2:00 AM UTC - cron: '0 2 * * *' workflow_dispatch: inputs: duration: description: 'Test duration in minutes' required: false default: '90' type: string pull_request: types: [labeled, synchronize, opened, reopened] permissions: contents: read # A pull request run is superseded by the next push. A 'labeled' event for any # other label gets a group of its own so it cannot cancel a run in progress. concurrency: group: ${{ github.workflow }}-${{ github.event.action == 'labeled' && github.event.label.name != 'soak' && github.run_id || github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: stability-test: name: Connection Stability Test # On a pull request only when it carries the 'soak' label, and not again # when some other label is added to it. if: >- github.event_name != 'pull_request' || (contains(github.event.pull_request.labels.*.name, 'soak') && (github.event.action != 'labeled' || github.event.label.name == 'soak')) runs-on: ubuntu-latest timeout-minutes: 120 # Allow extra time beyond test duration for setup/teardown env: DOTNET_VERSION: '10.0.401' TARGET_FRAMEWORK: 'net10.0' CONFIGURATION: 'Release' TESTPROJECT: './tests/Opc.Ua.Sessions.Tests/Opc.Ua.Sessions.Tests.csproj' TEST_DURATION_MINUTES: ${{ github.event_name == 'pull_request' && '30' || github.event.inputs.duration || '90' }} steps: - name: Checkout code uses: actions/checkout@v7 with: fetch-depth: 0 - name: Setup .NET ${{ env.DOTNET_VERSION }} uses: actions/setup-dotnet@v6 with: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Set Cloud Version shell: pwsh run: ./.azurepipelines/set-version.ps1 - name: Restore dependencies run: dotnet restore 'UA.slnx' - name: Build Sessions Tests run: > dotnet build ${{ env.TESTPROJECT }} --framework ${{ env.TARGET_FRAMEWORK }} --configuration ${{ env.CONFIGURATION }} --no-restore /p:CustomTestTarget=${{ env.TARGET_FRAMEWORK }} - name: Run Connection Stability Test run: | echo "Starting connection stability test for $TEST_DURATION_MINUTES minutes" dotnet test ${{ env.TESTPROJECT }} \ --configuration ${{ env.CONFIGURATION }} \ --no-build \ --framework ${{ env.TARGET_FRAMEWORK }} \ /p:CustomTestTarget=${{ env.TARGET_FRAMEWORK }} \ --filter "Category=ConnectionStability" \ --logger "trx;LogFileName=connection-stability.trx" \ --logger "console;verbosity=detailed" \ --results-directory ./TestResults timeout-minutes: 110 # Slightly longer than expected test duration # 'dotnet test' exits 0 when the filter matches nothing; until this check # existed the nightly run stayed green while running no test at all, from the # move of the test to Opc.Ua.Sessions.Tests (#3810, May 2026) until the workflow # was pointed at that project. - name: Check that the stability tests ran shell: pwsh run: ./.github/scripts/assert-tests-ran.ps1 -ResultsDirectory ./TestResults - name: Upload test results uses: actions/upload-artifact@v7 with: name: stability-test-results path: ./TestResults if: always()