Fixed racy test (#6584)
Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
parent
342396c7ee
commit
fc0a4dc141
|
@ -767,7 +767,7 @@ public class HttpOutputTest
|
|||
@Test
|
||||
public void testEmptyArray() throws Exception
|
||||
{
|
||||
AtomicBoolean committed = new AtomicBoolean();
|
||||
FuturePromise<Boolean> committed = new FuturePromise<>();
|
||||
AbstractHandler handler = new AbstractHandler()
|
||||
{
|
||||
@Override
|
||||
|
@ -775,8 +775,15 @@ public class HttpOutputTest
|
|||
{
|
||||
baseRequest.setHandled(true);
|
||||
response.setStatus(200);
|
||||
response.getOutputStream().write(new byte[0]);
|
||||
committed.set(response.isCommitted());
|
||||
try
|
||||
{
|
||||
response.getOutputStream().write(new byte[0]);
|
||||
committed.succeeded(response.isCommitted());
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
committed.failed(t);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -790,7 +797,7 @@ public class HttpOutputTest
|
|||
@Test
|
||||
public void testEmptyArrayKnown() throws Exception
|
||||
{
|
||||
AtomicBoolean committed = new AtomicBoolean();
|
||||
FuturePromise<Boolean> committed = new FuturePromise<>();
|
||||
AbstractHandler handler = new AbstractHandler()
|
||||
{
|
||||
@Override
|
||||
|
@ -799,8 +806,15 @@ public class HttpOutputTest
|
|||
baseRequest.setHandled(true);
|
||||
response.setStatus(200);
|
||||
response.setContentLength(0);
|
||||
response.getOutputStream().write(new byte[0]);
|
||||
committed.set(response.isCommitted());
|
||||
try
|
||||
{
|
||||
response.getOutputStream().write(new byte[0]);
|
||||
committed.succeeded(response.isCommitted());
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
committed.failed(t);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue