Fixed test that was spin looping causing lots of allocations and GC pressure.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
f620f99c78
commit
8057cb30ba
|
@ -230,14 +230,20 @@ public class HttpReceiverOverHTTPTest
|
|||
{
|
||||
return new HttpReceiverOverHTTP(this)
|
||||
{
|
||||
private boolean once = true;
|
||||
|
||||
@Override
|
||||
protected void fillInterested()
|
||||
{
|
||||
// Verify that the buffer has been released
|
||||
// before fillInterested() is called.
|
||||
assertNull(getResponseBuffer());
|
||||
// Fill the endpoint so receive is called again.
|
||||
endPoint.addInput("X");
|
||||
if (once)
|
||||
{
|
||||
once = false;
|
||||
// Verify that the buffer has been released
|
||||
// before fillInterested() is called.
|
||||
assertNull(getResponseBuffer());
|
||||
// Fill the endpoint so receive is called again.
|
||||
endPoint.addInput("X");
|
||||
}
|
||||
super.fillInterested();
|
||||
}
|
||||
};
|
||||
|
@ -260,5 +266,7 @@ public class HttpReceiverOverHTTPTest
|
|||
Response response = listener.get(5, TimeUnit.SECONDS);
|
||||
assertNotNull(response);
|
||||
assertEquals(200, response.getStatus());
|
||||
|
||||
Thread.sleep(2000);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue