Better fix for TrafficShapingHandlerTest

Motivation:
It seems that in certain conditions, the write back from the server is so quick that the handler has no time to compute traffic shaping. So 10ms of wait before acknowledging is added in server side.

Modifications:
Add 10ms waiting before server ackonwledge the client.

Result:
The timing is now suppsed to be stable.
This commit is contained in:
Frédéric Brégier 2014-08-16 10:54:00 +02:00
parent 4d20f03b6d
commit 4c30067b58

View File

@ -419,7 +419,7 @@ public class TrafficShapingHandlerTest extends AbstractSocketTest {
// still some message to get
return;
}
long minimalWait = (minimalWaitBetween != null) ? minimalWaitBetween[step] / 2 : 0;
long minimalWait = (minimalWaitBetween != null) ? minimalWaitBetween[step] : 0;
int ar = 0;
if (autoRead != null) {
if (step > 0 && autoRead[step - 1] != 0) {
@ -500,6 +500,7 @@ public class TrafficShapingHandlerTest extends AbstractSocketTest {
}
}
}
Thread.sleep(10);
loggerServer.debug("Step: " + step + " Write: " + nb);
for (int i = 0; i < nb; i++) {
channel.write(Unpooled.copyLong(timestamp));