Skip to content

Fix AttachmentMtomChunkingTest port collision with AttachmentChunkingTest#2972

Open
gnodet wants to merge 1 commit intomainfrom
fix/mtom-chunking-port-collision
Open

Fix AttachmentMtomChunkingTest port collision with AttachmentChunkingTest#2972
gnodet wants to merge 1 commit intomainfrom
fix/mtom-chunking-port-collision

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Mar 13, 2026

Summary

  • Both AttachmentChunkingTest and AttachmentMtomChunkingTest have inner classes named DownloadServer
  • Both use allocatePort(DownloadServer.class) which resolves to the same port via TestUtil (stores under the simple class name DownloadServer)
  • When both tests run in the same JVM, the second test fails with ListenerRegistrationException: Soap 1.1 endpoint already registered on address
  • Fix: use allocatePort(AttachmentMtomChunkingTest.class) to get a distinct port

Test plan

  • Both AttachmentChunkingTest and AttachmentMtomChunkingTest pass in the same surefire fork

🤖 Generated with Claude Code


public class AttachmentMtomChunkingTest extends AbstractAttachmentChunkingTest {
private static final String PORT = allocatePort(DownloadServer.class);
private static final String PORT = allocatePort(AttachmentMtomChunkingTest.class);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great finding @gnodet , however I think we would have to address the cause:

  • allocatePort() sets two properties, with full class name, and simple class name
  • the conflict is apparently over simple class name

It would be beneficial to improve TestUtil to catch those conflicts (it can do it, properties are static), so the test suite fails to run and would need to be fixed. Wdyt?

…Test

Both tests have an inner class named DownloadServer and use
allocatePort(DownloadServer.class). Since TestUtil stores ports under
the simple class name, both tests get the same port, causing
ListenerRegistrationException when the second test tries to publish
its endpoint.

Fix by using allocatePort(AttachmentMtomChunkingTest.class) to get a
distinct port.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet force-pushed the fix/mtom-chunking-port-collision branch from 2555f2a to d188dbc Compare March 13, 2026 21:59
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.

2 participants