Skip to content

Refactor MBeanServer tests to use custom service URL port #23699

@sbrannen

Description

@sbrannen

Overview

Several tests in our test suite that interact with an MBeanServer fail sporadically due to a BindException, indicating that multiple tests are attempting to create an MBeanServer on the same local port simultaneously. See SPR-PUBM-113 for an example.

Specifically, most of our JMX tests use the default service URL service:jmx:jmxmp://localhost:9875.

Commit b9013ad helps to mitigate build failures for such conflicts, but that is effectively only a "band aid" solution that doesn't actually address the underlying problem.

Proposal

We should refactor such tests to use SocketUtils to find an available port, compose a custom JMX service URL using that port, and start an MBeanServer for the particular test using that port.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions