Run StressTests (for 15 minutes) #1145
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run StressTests (for 15 minutes) | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # Runs every day at midnight UTC | |
| push: | |
| branches: [ main, develop ] | |
| paths-ignore: | |
| - '**.md' | |
| jobs: | |
| run_stress_tests: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest ] | |
| timeout-minutes: 70 # Allow some buffer time beyond the 1-hour test duration | |
| env: | |
| DisableRealDriverIO: "1" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # GitVersion.MsBuild needs full history | |
| - name: Setup .NET Core | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.x | |
| dotnet-quality: 'ga' | |
| - name: Install dependencies | |
| run: dotnet restore | |
| - name: Build StressTests | |
| run: dotnet build Tests/StressTests --configuration Debug --no-restore | |
| - name: Run StressTests for 15 minutes | |
| run: | | |
| end=$((SECONDS+900)) | |
| while [ $SECONDS -lt $end ]; do | |
| dotnet test --project Tests/StressTests --no-build --verbosity normal --diagnostic --diagnostic-output-directory logs/${{ runner.os }} | |
| done | |
| - name: Upload Test Logs | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: stress-test-logs-${{ runner.os }} | |
| path: | | |
| logs/ | |
| TestResults/StressTests | |
| parallel_unittests_stress: | |
| name: Parallel Unit Tests Stress (3 iterations) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest, windows-latest, macos-latest ] | |
| timeout-minutes: 90 | |
| env: | |
| DisableRealDriverIO: "1" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # GitVersion.MsBuild needs full history | |
| - name: Setup .NET Core | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.x | |
| dotnet-quality: 'ga' | |
| - name: Install dependencies | |
| run: dotnet restore | |
| - name: Build UnitTestsParallelizable | |
| run: dotnet build Tests/UnitTestsParallelizable --configuration Debug --no-restore | |
| - name: Disable Windows Defender (Windows only) | |
| if: runner.os == 'Windows' | |
| shell: powershell | |
| run: | | |
| Add-MpPreference -ExclusionPath "${{ github.workspace }}" | |
| Add-MpPreference -ExclusionProcess "dotnet.exe" | |
| - name: Run UnitTestsParallelizable (3 iterations) | |
| shell: bash | |
| run: | | |
| # Run tests 3 times to expose concurrency issues | |
| for RUN in {1..3}; do | |
| echo "============================================" | |
| echo "Starting test run $RUN of 3" | |
| echo "============================================" | |
| dotnet test \ | |
| --project Tests/UnitTestsParallelizable \ | |
| --no-build \ | |
| --verbosity normal \ | |
| --diagnostic --diagnostic-output-directory logs/UnitTestsParallelizable/${{ runner.os }}/run${RUN} | |
| if [ $? -ne 0 ]; then | |
| echo "ERROR: Test run $RUN failed!" | |
| exit 1 | |
| fi | |
| echo "Test run $RUN completed successfully" | |
| echo "" | |
| done | |
| echo "============================================" | |
| echo "All 3 test runs completed successfully!" | |
| echo "============================================" | |
| - name: Upload UnitTestsParallelizable Logs | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: parallel_unittests_stress-logs-${{ runner.os }} | |
| path: | | |
| logs/UnitTestsParallelizable/ | |
| TestResults/ |