Title: Stabilize flaky test: McpCompletionTests.testCompletionErrorOnMissingContext · Issue #902 · modelcontextprotocol/java-sdk · GitHub
Open Graph Title: Stabilize flaky test: McpCompletionTests.testCompletionErrorOnMissingContext · Issue #902 · modelcontextprotocol/java-sdk
X Title: Stabilize flaky test: McpCompletionTests.testCompletionErrorOnMissingContext · Issue #902 · modelcontextprotocol/java-sdk
Description: McpCompletionTests.testCompletionErrorOnMissingContext is sometimes failing and recovers after simple build restart. **Error:** Session not found:
Open Graph Description: McpCompletionTests.testCompletionErrorOnMissingContext is sometimes failing and recovers after simple build restart. **Error:** Session not found:
X Description: McpCompletionTests.testCompletionErrorOnMissingContext is sometimes failing and recovers after simple build restart. **Error:** Session not found: <sessionId> Likely causes: The server remove...
Opengraph URL: https://github.com/modelcontextprotocol/java-sdk/issues/902
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Stabilize flaky test: McpCompletionTests.testCompletionErrorOnMissingContext","articleBody":" McpCompletionTests.testCompletionErrorOnMissingContext is sometimes failing and recovers after simple build restart.\n` **Error:** Session not found: \u003csessionId\u003e`\n\nLikely causes:\nThe server removes the session when SSE connection closes, but the client still has pending requests in flight. This is a race condition between:\n- SSE connection closing → server removes session\n- Client sending next request → \"Session not found\"\n\n```\n2026-02-09 23:31:09 [HttpClient-1-Worker-0] WARN i.m.c.t.HttpClientSseClientTransport - SSE stream observed an error\njava.io.IOException: chunked transfer encoding, state: READING_LENGTH\n\tat java.net.http/jdk.internal.net.http.common.Utils.wrapWithExtraDetail(Utils.java:375)\n\tat java.net.http/jdk.internal.net.http.Http1Response$BodyReader.onReadError(Http1Response.java:660)\n\tat java.net.http/jdk.internal.net.http.Http1AsyncReceiver.checkForErrors(Http1AsyncReceiver.java:302)\n\tat java.net.http/jdk.internal.net.http.Http1AsyncReceiver.flush(Http1AsyncReceiver.java:268)\n\tat java.net.http/jdk.internal.net.http.common.SequentialScheduler$LockingRestartableTask.run(SequentialScheduler.java:205)\n\tat java.net.http/jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(SequentialScheduler.java:149)\n\tat java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base/java.lang.Thread.run(Thread.java:840)\nCaused by: java.io.EOFException: EOF reached while reading\n\tat java.net.http/jdk.internal.net.http.Http1AsyncReceiver$Http1TubeSubscriber.onComplete(Http1AsyncReceiver.java:597)\n\tat java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$ReadSubscription.signalCompletion(SocketTube.java:648)\n\tat java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.read(SocketTube.java:853)\n\tat java.net.http/jdk.internal.net.http.SocketTube$SocketFlowTask.run(SocketTube.java:181)\n\tat java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230)\n\tat java.net.http/jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:303)\n\tat java.net.http/jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:256)\n\tat java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.signalReadable(SocketTube.java:782)\n\tat java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$ReadEvent.signalEvent(SocketTube.java:965)\n\tat java.net.http/jdk.internal.net.http.SocketTube$SocketFlowEvent.handle(SocketTube.java:253)\n\tat java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.handleEvent(HttpClientImpl.java:1402)\n\tat java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.lambda$run$3(HttpClientImpl.java:1347)\n\tat java.base/java.util.ArrayList.forEach(ArrayList.java:1511)\n\tat java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:1347)\n2026-02-09 23:31:09 [ForkJoinPool.commonPool-worker-1] ERROR i.m.c.t.HttpClientSseClientTransport - Error sending message: Sending message failed with a non-OK HTTP code: 404 - {\"cause\":null,\"jsonRpcError\":null,\"localizedMessage\":\"Session not found: 7a9438d6-5965-456a-99af-26523f108d68\",\"message\":\"Session not found: 7a9438d6-5965-456a-99af-26523f108d68\",\"stackTrace\":\n```\nhttps://github.com/modelcontextprotocol/java-sdk/actions/runs/21845041347/job/63038831474#step:4:15277\n","author":{"url":"https://github.com/ashakirin","@type":"Person","name":"ashakirin"},"datePublished":"2026-04-04T12:38:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/902/java-sdk/issues/902"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:706fcd77-8a4f-3a21-c4d5-1eef5d96926e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E2B2:3C4BDB:7AF442:A3C7DD:6A5FD47A |
| html-safe-nonce | 7c6478b89fc8520ded443eb46c334001eb17f3f0fb770e82a02165eaa4968889 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMkIyOjNDNEJEQjo3QUY0NDI6QTNDN0REOjZBNUZENDdBIiwidmlzaXRvcl9pZCI6IjE4OTQ0NzA0MDM0MzczNTIwNTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a1de4f484e8697784ca3c14d35e1de11be65d16c6f26a2d485afcd362de85964 |
| hovercard-subject-tag | issue:4204830790 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/java-sdk/902/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1f9d92187dd6fbb29beedad14f3e108979ede4dc13c26c6cb950f1c0ba608dd8/modelcontextprotocol/java-sdk/issues/902 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1f9d92187dd6fbb29beedad14f3e108979ede4dc13c26c6cb950f1c0ba608dd8/modelcontextprotocol/java-sdk/issues/902 |
| og:image:alt | McpCompletionTests.testCompletionErrorOnMissingContext is sometimes failing and recovers after simple build restart. **Error:** Session not found: |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ashakirin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2a1904016bf220ad1311da188567b50f2c83d69b89a554fd8b017417589fbe29 |
| turbo-cache-control | no-preview |
| go-import | github.com/modelcontextprotocol/java-sdk git https://github.com/modelcontextprotocol/java-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 919609219 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/java-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 919609219 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/java-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f83c469daaa92993df0b1f479d525995ec8cc172 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width