diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
index 8854ad9eb..3a8fc1a6e 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -30,7 +30,7 @@ jobs:
distribution: 'temurin'
cache: maven
- name: Build with Maven and run tests
- run: mvn -B package --file pom.xml -fae ${{ matrix.os == 'windows-latest' && '-DskipDockerTests=true' || '' }}
+ run: mvn -B install --file pom.xml -fae ${{ matrix.os == 'windows-latest' && '-DskipDockerTests=true' || '' }}
- name: Upload Test Reports
if: failure()
uses: actions/upload-artifact@v7
diff --git a/pom.xml b/pom.xml
index 214264a17..59f77ff4c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -662,6 +662,43 @@
+
+ flaky-test-retry
+
+
+
+ .flaky-tests-marker
+
+
+
+
+
+ maven-surefire-plugin
+
+
+ default-test
+
+ flaky
+
+
+
+ flaky-tests
+
+ test
+
+
+ flaky
+ 3
+
+
+
+
+
+
+
diff --git a/reference/grpc/.flaky-tests-marker b/reference/grpc/.flaky-tests-marker
new file mode 100644
index 000000000..ade08c042
--- /dev/null
+++ b/reference/grpc/.flaky-tests-marker
@@ -0,0 +1,3 @@
+This marker file activates the "flaky-test-retry" profile defined in the root pom.xml.
+When present, tests annotated with @Tag("flaky") are excluded from the default surefire
+execution and run in a separate execution with up to 3 retries on failure.
diff --git a/reference/jsonrpc/.flaky-tests-marker b/reference/jsonrpc/.flaky-tests-marker
new file mode 100644
index 000000000..ade08c042
--- /dev/null
+++ b/reference/jsonrpc/.flaky-tests-marker
@@ -0,0 +1,3 @@
+This marker file activates the "flaky-test-retry" profile defined in the root pom.xml.
+When present, tests annotated with @Tag("flaky") are excluded from the default surefire
+execution and run in a separate execution with up to 3 retries on failure.
diff --git a/reference/rest/.flaky-tests-marker b/reference/rest/.flaky-tests-marker
new file mode 100644
index 000000000..ade08c042
--- /dev/null
+++ b/reference/rest/.flaky-tests-marker
@@ -0,0 +1,3 @@
+This marker file activates the "flaky-test-retry" profile defined in the root pom.xml.
+When present, tests annotated with @Tag("flaky") are excluded from the default surefire
+execution and run in a separate execution with up to 3 retries on failure.
diff --git a/tests/multiversion/grpc/.flaky-tests-marker b/tests/multiversion/grpc/.flaky-tests-marker
new file mode 100644
index 000000000..ade08c042
--- /dev/null
+++ b/tests/multiversion/grpc/.flaky-tests-marker
@@ -0,0 +1,3 @@
+This marker file activates the "flaky-test-retry" profile defined in the root pom.xml.
+When present, tests annotated with @Tag("flaky") are excluded from the default surefire
+execution and run in a separate execution with up to 3 retries on failure.
diff --git a/tests/multiversion/jsonrpc/.flaky-tests-marker b/tests/multiversion/jsonrpc/.flaky-tests-marker
new file mode 100644
index 000000000..ade08c042
--- /dev/null
+++ b/tests/multiversion/jsonrpc/.flaky-tests-marker
@@ -0,0 +1,3 @@
+This marker file activates the "flaky-test-retry" profile defined in the root pom.xml.
+When present, tests annotated with @Tag("flaky") are excluded from the default surefire
+execution and run in a separate execution with up to 3 retries on failure.
diff --git a/tests/multiversion/rest/.flaky-tests-marker b/tests/multiversion/rest/.flaky-tests-marker
new file mode 100644
index 000000000..ade08c042
--- /dev/null
+++ b/tests/multiversion/rest/.flaky-tests-marker
@@ -0,0 +1,3 @@
+This marker file activates the "flaky-test-retry" profile defined in the root pom.xml.
+When present, tests annotated with @Tag("flaky") are excluded from the default surefire
+execution and run in a separate execution with up to 3 retries on failure.
diff --git a/tests/server-common/src/test/java/org/a2aproject/sdk/server/apps/common/AbstractA2AServerTest.java b/tests/server-common/src/test/java/org/a2aproject/sdk/server/apps/common/AbstractA2AServerTest.java
index c5ab7de4b..fa69f0624 100644
--- a/tests/server-common/src/test/java/org/a2aproject/sdk/server/apps/common/AbstractA2AServerTest.java
+++ b/tests/server-common/src/test/java/org/a2aproject/sdk/server/apps/common/AbstractA2AServerTest.java
@@ -88,6 +88,7 @@
import org.a2aproject.sdk.spec.UnsupportedOperationError;
import org.a2aproject.sdk.spec.UpdateEvent;
import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
@@ -782,6 +783,7 @@ public void testSendMessageStreamExistingTaskSuccess() throws Exception {
}
@Test
+ @Tag("flaky")
@Timeout(value = 3, unit = TimeUnit.MINUTES)
public void testSubscribeExistingTaskSuccess() throws Exception {
saveTaskInTaskStore(MINIMAL_TASK);
@@ -1711,6 +1713,7 @@ public void testDeletePushNotificationConfigSetWithoutConfigId() throws Exceptio
}
@Test
+ @Tag("flaky")
@Timeout(value = 1, unit = TimeUnit.MINUTES)
public void testNonBlockingWithMultipleMessages() throws Exception {
AtomicReference generatedTaskIdRef = new AtomicReference<>();
@@ -3076,6 +3079,7 @@ public void testAgentToAgentDelegation() throws Exception {
*
*/
@Test
+ @Tag("flaky")
public void testAgentToAgentLocalHandling() throws Exception {
// No taskId - server generates one; routing is by message content prefix "a2a-local:"
Message localMessage = Message.builder()