Skip to content

Commit 65f4c93

Browse files
authored
Fix: this is a fix for a2a-tck issue 36 (#202)
# Description Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ x] Follow the [`CONTRIBUTING` Guide](../CONTRIBUTING.md). - [ x] Make your Pull Request title in the <https://www.conventionalcommits.org/> specification. - Important Prefixes for [release-please](https://github.com/googleapis/release-please): - `fix:` which represents bug fixes, and correlates to a [SemVer](https://semver.org/) patch. - `feat:` represents a new feature, and correlates to a SemVer minor. - `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change (indicated by the `!`) and will result in a SemVer major. - [ x] Ensure the tests pass - [ x] Appropriate READMEs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕
1 parent 6caee8e commit 65f4c93

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tck/src/main/java/io/a2a/tck/server/AgentExecutorProducer.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,21 @@ public void execute(RequestContext context, EventQueue eventQueue) throws JSONRP
3939
eventQueue.enqueueEvent(task);
4040
}
4141

42+
if (context.getMessage().getMessageId().startsWith("test-resubscribe-message-id")) {
43+
int timeoutMs = Integer.parseInt(System.getenv().getOrDefault("RESUBSCRIBE_TIMEOUT_MS", "3000"));
44+
System.out.println("====> task id starts with test-resubscribe-message-id, sleeping for " + timeoutMs + " ms");
45+
try {
46+
Thread.sleep(timeoutMs);
47+
} catch (InterruptedException e) {
48+
Thread.currentThread().interrupt();
49+
}
50+
}
4251
TaskUpdater updater = new TaskUpdater(context, eventQueue);
4352

4453
// Immediately set to WORKING state
4554
updater.startWork();
4655
System.out.println("====> task set to WORKING, starting background execution");
47-
56+
4857
// Method returns immediately - task continues in background
4958
System.out.println("====> execute() method returning immediately, task running in background");
5059
}

0 commit comments

Comments
 (0)