Skip to content

Servlet tests: use one Tomcat per test - #1309

Merged
Kehrlann merged 1 commit into
mainfrom
dgarnier/sse-tests-tomcat-per-test
Nov 3, 2026
Merged

Kehrlann merged 1 commit into
mainfrom
dgarnier/sse-tests-tomcat-per-test

Conversation

@Kehrlann

@Kehrlann Kehrlann commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

tl;dr use one Tomcat per test instead of per class. This should stabilize CI flakes.

Revert the remaining classes of #1118 to one Tomcat per test: HttpServletStatelessIntegrationTests, HttpServletStatelessShared- IntegrationTests, HttpServletStreamableIntegrationTests and McpCompletionTests. McpSyncListFilteringIntegrationTests, which shared a Tomcat and a transport per server type, now gets a fresh one for each test too.

With a shared Tomcat, a stream still being written to after its client went away can corrupt a connection of a later test, which then fails with "HTTP/1.1 header parser received no bytes".

Bind test Tomcats to 127.0.0.1 in TomcatTestUtil, rather than in HttpServletSseIntegrationTests only: with the wildcard address, every stop waits a full second on macOS. This makes the per-test classes as fast as, or faster than, they were with a shared Tomcat.

Revert the core of the change of #1118, and use one Tomcat per test
instead of per class. McpSyncListFilteringIntegrationTests, which shared
a Tomcat and a transport per server type, now gets a fresh one for each
test too.

With a shared Tomcat, a stream still being written to after its client
went away can corrupt a connection of a later test, which then fails
with "HTTP/1.1 header parser received no bytes".

Bind test Tomcats to 127.0.0.1 in TomcatTestUtil, rather than in
HttpServletSseIntegrationTests only: with the wildcard address, every
stop waits a full second on macOS. This makes the per-test classes as
fast as, or faster than, they were with a shared Tomcat.

Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
@Kehrlann
Kehrlann force-pushed the dgarnier/sse-tests-tomcat-per-test branch from 339accb to b8cb19f Compare November 2, 2026 20:44
@Kehrlann
Kehrlann merged commit 88ebcb7 into main Nov 3, 2026
26 checks passed
@Kehrlann
Kehrlann deleted the dgarnier/sse-tests-tomcat-per-test branch November 3, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant