Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix or Usage Issue
-
Affects Version/s: 2.0.0-M1
-
Fix Version/s: None
-
Component/s: Core: Configuration
-
Labels:None
-
User impact:Low
-
Similar Issues:None
Description
Sometimes tests seem to fail due to port conflicts. We could avoid this by making port numbers auto-increment. One way to implement this would be to use a variable like "${MULE_SEQUENTIAL_PORT}" in the config and then implement a custom property placeholder handler.
If this were used to set global endpoints in the config these could then be accessed from the Java test code (the test would send to the global name and have no need to know the port number).
We could extend the test framework to restart tests a second time on error. If the port number were taken from a global (thread safe) counter we would get new ports for each test.
Extend it further. Have it check extra MULE_SEQUENTIAL_PORT_START and MULE_SEQUENTIAL_PORT_END variables, and throw a normal error if still couldn't bind. Then you can have different groups for port ranges, and after then learn to know when to stop