|
| 1 | +name: Test Event Race Condition (Loop 100x) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + test-loop: |
| 10 | + name: Test Loop (${{ matrix.transport }}, JDK ${{ matrix.java }}) |
| 11 | + runs-on: ubuntu-latest |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + java: ['17', '21', '25'] |
| 16 | + transport: ['rest', 'jsonrpc', 'grpc'] |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Checkout code |
| 20 | + uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - name: Set up JDK ${{ matrix.java }} |
| 23 | + uses: actions/setup-java@v4 |
| 24 | + with: |
| 25 | + java-version: ${{ matrix.java }} |
| 26 | + distribution: 'temurin' |
| 27 | + cache: 'maven' |
| 28 | + |
| 29 | + - name: Build project (skip tests) |
| 30 | + run: mvn clean install -DskipTests -B -V |
| 31 | + |
| 32 | + - name: Run tests in loop (100 iterations) |
| 33 | + run: | |
| 34 | + MODULE="reference/${{ matrix.transport }}" |
| 35 | + TEST_CLASS="QuarkusA2ARestJdkTest" |
| 36 | +
|
| 37 | + # Different test class names for different transports |
| 38 | + if [ "${{ matrix.transport }}" == "jsonrpc" ]; then |
| 39 | + TEST_CLASS="QuarkusA2AJSONRPCJdkTest" |
| 40 | + elif [ "${{ matrix.transport }}" == "grpc" ]; then |
| 41 | + TEST_CLASS="QuarkusA2AGrpcTest" |
| 42 | + fi |
| 43 | +
|
| 44 | + TESTS="${TEST_CLASS}#testAgentToAgentLocalHandling+testNonBlockingWithMultipleMessages+testAuthRequiredWorkflow" |
| 45 | +
|
| 46 | + echo "Module: ${MODULE}" |
| 47 | + echo "Test class: ${TEST_CLASS}" |
| 48 | + echo "Running tests: ${TESTS}" |
| 49 | +
|
| 50 | + for i in {1..100}; do |
| 51 | + echo "===================================================================" |
| 52 | + echo "Iteration $i/100" |
| 53 | + echo "===================================================================" |
| 54 | +
|
| 55 | + mvn test -pl "${MODULE}" -Dtest="${TESTS}" -B |
| 56 | +
|
| 57 | + if [ $? -ne 0 ]; then |
| 58 | + echo "❌ Test failed on iteration $i" |
| 59 | + exit 1 |
| 60 | + fi |
| 61 | +
|
| 62 | + echo "✅ Iteration $i passed" |
| 63 | + done |
| 64 | +
|
| 65 | + echo "===================================================================" |
| 66 | + echo "✅ All 100 iterations passed!" |
| 67 | + echo "===================================================================" |
| 68 | +
|
| 69 | + - name: Upload surefire reports on failure |
| 70 | + if: failure() |
| 71 | + uses: actions/upload-artifact@v4 |
| 72 | + with: |
| 73 | + name: surefire-reports-${{ matrix.transport }}-jdk${{ matrix.java }} |
| 74 | + path: reference/${{ matrix.transport }}/target/surefire-reports/ |
| 75 | + retention-days: 7 |
0 commit comments