|
97 | 97 | done |
98 | 98 | |
99 | 99 | - name: Run TCK |
| 100 | + id: run-tck |
| 101 | + timeout-minutes: 5 |
100 | 102 | run: | |
101 | 103 | ./run_tck.py --sut-url ${{ env.SUT_JSONRPC_URL }} --category all --transports jsonrpc,grpc,rest --compliance-report report.json |
102 | 104 | working-directory: tck/a2a-tck |
| 105 | + - name: Capture Thread Dump |
| 106 | + if: failure() |
| 107 | + run: | |
| 108 | + # Find the actual Quarkus JVM (child of Maven process), not the Maven parent |
| 109 | + # Look for the dev.jar process which is the actual application |
| 110 | + QUARKUS_PID=$(pgrep -f "a2a-tck-server-dev.jar" || echo "") |
| 111 | + if [ -n "$QUARKUS_PID" ]; then |
| 112 | + echo "📊 Capturing thread dump for Quarkus JVM PID $QUARKUS_PID" |
| 113 | + jstack $QUARKUS_PID > tck/target/thread-dump.txt || echo "Failed to capture thread dump" |
| 114 | + if [ -f tck/target/thread-dump.txt ]; then |
| 115 | + echo "✅ Thread dump captured ($(wc -l < tck/target/thread-dump.txt) lines)" |
| 116 | + fi |
| 117 | + else |
| 118 | + echo "⚠️ No Quarkus JVM process found for thread dump" |
| 119 | + echo "Available Java processes:" |
| 120 | + ps aux | grep java || true |
| 121 | + fi |
| 122 | + - name: Capture Heap Dump |
| 123 | + if: failure() |
| 124 | + run: | |
| 125 | + # Find the actual Quarkus JVM (child of Maven process), not the Maven parent |
| 126 | + QUARKUS_PID=$(pgrep -f "a2a-tck-server-dev.jar" || echo "") |
| 127 | + if [ -n "$QUARKUS_PID" ]; then |
| 128 | + echo "📊 Capturing heap dump for Quarkus JVM PID $QUARKUS_PID" |
| 129 | + jmap -dump:live,format=b,file=tck/target/heap-dump.hprof $QUARKUS_PID || echo "Failed to capture heap dump" |
| 130 | + if [ -f tck/target/heap-dump.hprof ]; then |
| 131 | + SIZE=$(du -h tck/target/heap-dump.hprof | cut -f1) |
| 132 | + echo "✅ Heap dump captured ($SIZE)" |
| 133 | + # Compress to reduce artifact size |
| 134 | + gzip tck/target/heap-dump.hprof |
| 135 | + COMPRESSED_SIZE=$(du -h tck/target/heap-dump.hprof.gz | cut -f1) |
| 136 | + echo "✅ Compressed heap dump ($COMPRESSED_SIZE)" |
| 137 | + fi |
| 138 | + else |
| 139 | + echo "⚠️ No Quarkus JVM process found for heap dump" |
| 140 | + echo "Available Java processes:" |
| 141 | + ps aux | grep java || true |
| 142 | + fi |
| 143 | + - name: Stop Quarkus Server |
| 144 | + if: always() |
| 145 | + run: | |
| 146 | + # Find and kill the Quarkus process to ensure logs are flushed |
| 147 | + pkill -f "quarkus:dev" || true |
| 148 | + sleep 2 |
| 149 | + - name: Verify TCK Log |
| 150 | + if: failure() |
| 151 | + run: | |
| 152 | + echo "Checking for log file..." |
| 153 | + if [ -f tck/target/tck-test.log ]; then |
| 154 | + echo "✅ Log file exists ($(wc -l < tck/target/tck-test.log) lines)" |
| 155 | + ls -lh tck/target/tck-test.log |
| 156 | + else |
| 157 | + echo "❌ Log file not found at tck/target/tck-test.log" |
| 158 | + echo "Contents of tck/target/:" |
| 159 | + ls -la tck/target/ || echo "tck/target/ does not exist" |
| 160 | + fi |
| 161 | + - name: Upload TCK Log |
| 162 | + if: failure() |
| 163 | + uses: actions/upload-artifact@v4 |
| 164 | + with: |
| 165 | + name: tck-test-log-java-${{ matrix.java-version }} |
| 166 | + path: tck/target/tck-test.log |
| 167 | + retention-days: 2 |
| 168 | + if-no-files-found: warn |
| 169 | + - name: Upload Thread Dump |
| 170 | + if: failure() |
| 171 | + uses: actions/upload-artifact@v4 |
| 172 | + with: |
| 173 | + name: thread-dump-java-${{ matrix.java-version }} |
| 174 | + path: tck/target/thread-dump.txt |
| 175 | + retention-days: 2 |
| 176 | + if-no-files-found: warn |
| 177 | + - name: Upload Heap Dump |
| 178 | + if: failure() |
| 179 | + uses: actions/upload-artifact@v4 |
| 180 | + with: |
| 181 | + name: heap-dump-java-${{ matrix.java-version }} |
| 182 | + path: tck/target/heap-dump.hprof.gz |
| 183 | + retention-days: 2 |
| 184 | + if-no-files-found: warn |
0 commit comments