Skip to content

[Flaky Test] RestChatAgentWithMcpConnectorIT.testChatAgentWithMcpStreamableHttpConnector #4935

Description

@nathaliellenaa

What is the bug?
Flaky integration test, sample failing CI: https://github.com/opensearch-project/ml-commons/actions/runs/30130755579/job/89604709649

RestChatAgentWithMcpConnectorIT > testChatAgentWithMcpStreamableHttpConnector STANDARD_ERROR
    REPRODUCE WITH: ./gradlew ':opensearch-ml-plugin:integTest' --tests 'org.opensearch.ml.rest.RestChatAgentWithMcpConnectorIT.testChatAgentWithMcpStreamableHttpConnector' -Dtests.seed=B1F17290950072A -Dtests.security.manager=false -Dtests.locale=sq -Dtests.timezone=Asia/Harbin -Druntime.java=25 -Djava.security.properties=/__w/ml-commons/ml-commons/distribution/src/config/fips_java.security

RestChatAgentWithMcpConnectorIT > testChatAgentWithMcpStreamableHttpConnector FAILED
    org.opensearch.client.ResponseException: method [POST], host [http://127.0.0.1:39049/], URI [/_plugins/_ml/agents/EcpJlp8BShJKgHXiW35h/_execute], status line [HTTP/1.1 400 Bad Request]
    {"status":400,"error":{"type":"OpenSearchStatusException","reason":"Invalid Request","details":"Error from remote service: {\"message\":\"The provided request is not valid\"}"}}
        at __randomizedtesting.SeedInfo.seed([B1F17290950072A:FED5EB9E818EC05E]:0)
        at app//org.opensearch.client.RestClient.convertResponse(RestClient.java:498)
        at app//org.opensearch.client.RestClient.performRequest(RestClient.java:387)

        at app//org.opensearch.client.RestClient.performRequest(RestClient.java:362)

        at app//org.opensearch.ml.utils.TestHelper.performRequestWithRemoteRetry(TestHelper.java:216)
Suite: Test class org.opensearch.ml.rest.RestChatAgentWithMcpConnectorIT
        at app//org.opensearch.ml.utils.TestHelper.makeRequest(TestHelper.java:207)
  2> korr 25, 2026 6:40:39 E PARADITES org.opensearch.client.RestClient logResponse
  2> WARNING: request [DELETE http://[::1]:37057/.plugins-ml-mcp-tools] returned 1 warnings: [299 OpenSearch-3.8.0-SNAPSHOT-1a9c84fc5c7a40515ba89dd16bc1c3a772dc28af "this request accesses system indices: [.plugins-ml-mcp-tools], but in a future major version, direct access to system indices will be prevented by default"]
  2> REPRODUCE WITH: ./gradlew ':opensearch-ml-plugin:integTest' --tests 'org.opensearch.ml.rest.RestChatAgentWithMcpConnectorIT.testChatAgentWithMcpStreamableHttpConnector' -Dtests.seed=B1F17290950072A -Dtests.security.manager=false -Dtests.locale=sq -Dtests.timezone=Asia/Harbin -Druntime.java=25 -Djava.security.properties=/__w/ml-commons/ml-commons/distribution/src/config/fips_java.security
  2> org.opensearch.client.ResponseException: method [POST], host [http://127.0.0.1:39049/], URI [/_plugins/_ml/agents/EcpJlp8BShJKgHXiW35h/_execute], status line [HTTP/1.1 400 Bad Request]
        at app//org.opensearch.ml.utils.TestHelper.makeRequest(TestHelper.java:180)
        at app//org.opensearch.ml.rest.RestChatAgentWithMcpConnectorIT.testChatAgentWithMcpStreamableHttpConnector(RestChatAgentWithMcpConnectorIT.java:201)

RestChatAgentWithMcpConnectorIT STANDARD_ERROR
    NOTE: leaving temporary files on disk at: /__w/ml-commons/ml-commons/plugin/build/testrun/integTest/temp/org.opensearch.ml.rest.RestChatAgentWithMcpConnectorIT_B1F17290950072A-001
    NOTE: test params are: codec=Asserting(Lucene104): {}, docValues:{}, maxPointsInLeafNode=2043, maxMBSortInHeap=5.972259641969541, sim=Asserting(RandomSimilarity(queryNorm=false): {}), locale=sq, timezone=Asia/Harbin
    NOTE: Linux 6.17.0-1020-azure amd64/Azul Systems, Inc. 25.0.4 (64-bit)/cpus=4,threads=1,free=463889480,total=536870912
    NOTE: All tests run in this JVM: [HFAnalyzerIT, MLModelAutoReDeployerIT, MLContextManagementOverrideRestIT, MLContextManagementRestIT, RestBedRockInferenceIT, RestChatAgentIT, RestChatAgentWithMcpConnectorIT]
  1> [2026-07-24T22:40:15,653][INFO ][o.o.m.r.RestChatAgentWithMcpConnectorIT] [testChatAgentWithMcpStreamableHttpConnector] before test
  1> [2026-07-24T22:40:15,653][INFO ][o.o.m.r.RestChatAgentWithMcpConnectorIT] [testChatAgentWithMcpStreamableHttpConnector] initializing REST clients against [http://[::1]:34815, http://127.0.0.1:39049,/ http://[::1]:33129, http://127.0.0.1:35193,/ http://[::1]:37057, http://127.0.0.1:36245]/
  1> [2026-07-24T22:40:39,288][INFO ][o.o.m.r.RestChatAgentWithMcpConnectorIT] [testChatAgentWithMcpStreamableHttpConnector] after test
    {"status":400,"error":{"type":"OpenSearchStatusException","reason":"Invalid Request","details":"Error from remote service: {\"message\":\"The provided request is not valid\"}"}}
        at __randomizedtesting.SeedInfo.seed([B1F17290950072A:FED5EB9E818EC05E]:0)
        at app//org.opensearch.client.RestClient.convertResponse(RestClient.java:498)
        at app//org.opensearch.client.RestClient.performRequest(RestClient.java:387)
        at app//org.opensearch.client.RestClient.performRequest(RestClient.java:362)
        at app//org.opensearch.ml.utils.TestHelper.performRequestWithRemoteRetry(TestHelper.java:216)
        at app//org.opensearch.ml.utils.TestHelper.makeRequest(TestHelper.java:207)
        at app//org.opensearch.ml.utils.TestHelper.makeRequest(TestHelper.java:180)
        at app//org.opensearch.ml.rest.RestChatAgentWithMcpConnectorIT.testChatAgentWithMcpStreamableHttpConnector(RestChatAgentWithMcpConnectorIT.java:201)
  2> NOTE: leaving temporary files on disk at: /__w/ml-commons/ml-commons/plugin/build/testrun/integTest/temp/org.opensearch.ml.rest.RestChatAgentWithMcpConnectorIT_B1F17290950072A-001
  2> NOTE: test params are: codec=Asserting(Lucene104): {}, docValues:{}, maxPointsInLeafNode=2043, maxMBSortInHeap=5.972259641969541, sim=Asserting(RandomSimilarity(queryNorm=false): {}), locale=sq, timezone=Asia/Harbin
  2> NOTE: Linux 6.17.0-1020-azure amd64/Azul Systems, Inc. 25.0.4 (64-bit)/cpus=4,threads=1,free=463889480,total=536870912
  2> NOTE: All tests run in this JVM: [HFAnalyzerIT, MLModelAutoReDeployerIT, MLContextManagementOverrideRestIT, MLContextManagementRestIT, RestBedRockInferenceIT, RestChatAgentIT, RestChatAgentWithMcpConnectorIT]

How can one reproduce the bug?

REPRODUCE WITH: ./gradlew ':opensearch-ml-plugin:integTest' --tests 'org.opensearch.ml.rest.RestChatAgentWithMcpConnectorIT.testChatAgentWithMcpStreamableHttpConnector' -Dtests.seed=B1F17290950072A -Dtests.security.manager=false -Dtests.locale=sq -Dtests.timezone=Asia/Harbin -Druntime.java=25 -Djava.security.properties=/__w/ml-commons/ml-commons/distribution/src/config/fips_java.security

What is the expected behavior?
Test should consistently passing

What is your host/environment?

  • OS: [e.g. iOS]
  • Version [e.g. 22]
  • Plugins

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

Do you have any additional context?
Add any other context about the problem.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions