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