xintongsong commented on code in PR #771:
URL: https://github.com/apache/flink-agents/pull/771#discussion_r3367862973


##########
integrations/mcp/src/test/java/org/apache/flink/agents/integrations/mcp/MCPServerTest.java:
##########
@@ -71,6 +74,28 @@ void testSimpleConstructor() {
         assertThat(server.getAuth()).isNull();
     }
 
+    @Test
+    @DisabledOnJre(JRE.JAVA_11)
+    @DisplayName("Read timeout from ResourceDescriptor")
+    void testTimeoutFromResourceDescriptor() {
+        ResourceDescriptor descriptor =
+                ResourceDescriptor.Builder.newBuilder(ResourceName.MCP_SERVER)
+                        .addInitialArgument("endpoint", DEFAULT_ENDPOINT)
+                        .addInitialArgument("timeout", 60)
+                        .build();
+
+        MCPServer server =
+                new MCPServer(
+                        descriptor,
+                        ResourceContext.fromGetResource(
+                                (name, type) -> {
+                                    throw new UnsupportedOperationException(
+                                            "No dependencies expected");
+                                }));
+
+        assertThat(server.getTimeoutSeconds()).isEqualTo(60);

Review Comment:
   I think this is a bigger question: How do we systematically guarantee apis / 
option-keys consistency across docs, java / python / yaml apis, and the json 
plan? Not only for `timeout`, but potentially for all args passed via resource 
descriptors.
   
   I don't have any concrete plan. Just one preliminary idea: we may introduce 
some option key constants (like `ResourceName`), so that we can verify the 
constants are consistent between java and python with test cases, and also 
reduce the chance of typo and silent ignore on user side.
   
   And that should be out of the scope of this PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to