org.mule.transport.tcp.issues
Class ReuseExperimentMule2067TestCase
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.mule.tck.AbstractMuleTestCase
org.mule.transport.tcp.issues.ReuseExperimentMule2067TestCase
- All Implemented Interfaces:
- Test, TestCaseWatchdogTimeoutHandler
public class ReuseExperimentMule2067TestCase
- extends AbstractMuleTestCase
Can we avoid the "address already in use" errors by using SO_REUSEADDR?
Typical results are
[07-24 19:32:49] INFO ReuseExperimentMule2067TestCase [main]: Measuring average run length for 100 repeats without reuse and a pause of 100 ms
[07-24 19:33:49] INFO ReuseExperimentMule2067TestCase [main]: Average run length: 57.3 +/- 33.15131973240282
[07-24 19:33:49] INFO ReuseExperimentMule2067TestCase [main]: Measuring average run length for 100 repeats with reuse and a pause of 100 ms
[07-24 19:35:32] INFO ReuseExperimentMule2067TestCase [main]: Average run length: 100.0 +/- 0.0
[07-24 19:35:32] INFO ReuseExperimentMule2067TestCase [main]: Measuring average run length for 100 repeats without reuse and a pause of 10 ms
[07-24 19:35:48] INFO ReuseExperimentMule2067TestCase [main]: Average run length: 96.8 +/- 7.332121111929359
[07-24 19:35:48] INFO ReuseExperimentMule2067TestCase [main]: Measuring average run length for 100 repeats with reuse and a pause of 10 ms
[07-24 19:36:04] INFO ReuseExperimentMule2067TestCase [main]: Average run length: 100.0 +/- 0.0
[07-24 19:36:04] INFO ReuseExperimentMule2067TestCase [main]: Measuring average run length for 100 repeats without reuse and a pause of 1 ms
[07-24 19:36:10] INFO ReuseExperimentMule2067TestCase [main]: Average run length: 75.8 +/- 37.690317058894586
[07-24 19:36:10] INFO ReuseExperimentMule2067TestCase [main]: Measuring average run length for 100 repeats with reuse and a pause of 1 ms
[07-24 19:36:18] INFO ReuseExperimentMule2067TestCase [main]: Average run length: 100.0 +/- 0.0
which suggest that enabling address re-use could help with the issue.
Note that if a single socket (ie a single port number) is reused for all tests we often
zeroes eveywhere (even with waits of 2sec and similar between iterations/tests). This
suggests that once the error occurs, the socket enters a long-lived "broken" state.
All this is by AC on linux, dual CPU, Java 1.4 - I suspect results will vary like crazy
in different contexts.
Method Summary |
protected void |
measureMeanRunLength(int sampleSize,
int numberOfRepeats,
int numberOfConnections,
int port,
long pause,
boolean reuse)
|
protected void |
openCloseClientServer(int numberOfConnections,
int port,
boolean reuse)
|
protected void |
pause(long pause)
|
protected int |
repeatOpenCloseClientServer(int numberOfRepeats,
int numberOfConnections,
int port,
long pause,
boolean reuse,
boolean noFail)
|
void |
testMeasureImprovement()
|
void |
testReuse()
|
Methods inherited from class org.mule.tck.AbstractMuleTestCase |
configureMuleContext, createMuleContext, createTestInfo, createWatchdog, disposeManager, doSetUp, doTearDown, getBuilder, getConfigurationResources, getName, getStartUpProperties, getTestConnector, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEventContext, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEvent, getTestInfo, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestService, getTestService, getTestService, getTestSession, getTestTransformer, handleTimeout, isDisabledInThisEnvironment, isDisabledInThisEnvironment, isDisposeManagerPerSuite, isExcluded, isOffline, isStartContext, registerTestMethod, run, runBare, setDisposeManagerPerSuite, setName, setStartContext, setUp, suitePostTearDown, suitePreSetUp, tearDown |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
ReuseExperimentMule2067TestCase
public ReuseExperimentMule2067TestCase()
testReuse
public void testReuse()
throws IOException
- Throws:
IOException
testMeasureImprovement
public void testMeasureImprovement()
throws IOException
- Throws:
IOException
measureMeanRunLength
protected void measureMeanRunLength(int sampleSize,
int numberOfRepeats,
int numberOfConnections,
int port,
long pause,
boolean reuse)
throws IOException
- Throws:
IOException
repeatOpenCloseClientServer
protected int repeatOpenCloseClientServer(int numberOfRepeats,
int numberOfConnections,
int port,
long pause,
boolean reuse,
boolean noFail)
throws IOException
- Throws:
IOException
openCloseClientServer
protected void openCloseClientServer(int numberOfConnections,
int port,
boolean reuse)
throws IOException
- Throws:
IOException
pause
protected void pause(long pause)
Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.