Skip session activity tracking when sessionSweepInterval is null

Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
This commit is contained in:
Daniel Garnier-Moiroux 2026-09-16 13:39:38 +02:00 • committed by Daniel Garnier-Moiroux
commit 1178539050

View file

@ -448,13 +448,14 @@ class HttpServletStreamableIntegrationTests extends AbstractMcpClientServerInteg
@Test
void sessionIsNotEvictedWithoutSweepInterval() throws Exception {
// Sweeping is opt-in: a transport configured without an interval keeps its
// sessions until they are deleted or the server shuts down
// Sweeping can be turned off: such a transport keeps its sessions until they are
// deleted or the server shuts down
mcpServerTransportProvider.closeGracefully().block();
mcpServerTransportProvider = HttpServletStreamableServerTransportProvider.builder()
.contextExtractor(TEST_CONTEXT_EXTRACTOR)
.mcpEndpoint(MESSAGE_ENDPOINT)
.keepAliveInterval(KEEP_ALIVE_INTERVAL)
.sessionSweepInterval(null)
.build();
MCP_SERVLET.setDelegate(mcpServerTransportProvider);
prepareAsyncServerBuilder().serverInfo("test-server", "1.0.0").build();