Status: Closed (View Workflow)
Affects Version/s: JBossAS-4.0.4.GA, JBossAS-4.0.5.GA, JBossAS-5.0.0.Beta1, JBossAS-5.0.0.Beta2
Windows XP and Unisys MCP system
When running the testsuite test org.jboss.test.cluster.test.ScopedSetTriggerTestCase, the test fails on the following assertion:
junit.framework.ComparisonFailure: Attributes should be the same expected:<...Ben...> but was:<...Joe...>
This failure occurs when running on the Unisys MCP system, which demonstrates different timings than when running on a system like Windows.
After analyzing the results and the code, the following appears to be the root cause of the test failure:
org.jboss.web.tomcat.tc5.session.ClusteredSession has a method calcMaxUnreplicatedInterval that is used to calculate maxUnreplicatedInterval. maxUnreplicatedInterval is the maximum time interval before a session is replicated to the other cluster nodes. When this time period is exceeded, the session is replicated even if the session is not "dirty". maxUnreplicatedInterval is in milliseconds, but maxInactiveInterval is in seconds. However, calcMaxUnreplicatedInterval computes maxUnreplicatedInterval as follows:
maxUnreplicatedInterval = maxInactiveInterval * maxUnreplicatedFactor / 100;
where maxUnreplicatedFactor is 80. Since maxInactiveInterval is in seconds, the correct computation should be:
maxUnreplicatedInterval = maxInactiveInterval * 1000 * maxUnreplicatedFactor / 100;
As a result of the incorrect computation of maxUnreplicatedInterval, the session is automatically replicated much more often than was intended.
In this case, the session timeout was configured as 30 minutes or 1800 seconds. So, maxUnreplicatedInterval becomes 1440 milliseconds. Therefore, if the test takes more than about a second and a half to run, the test will not produce the expected results.