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
|
@Test
|
||||||
public void testEmptyArray() throws Exception
|
public void testEmptyArray() throws Exception
|
||||||
{
|
{
|
||||||
AtomicBoolean committed = new AtomicBoolean();
|
FuturePromise<Boolean> committed = new FuturePromise<>();
|
||||||
AbstractHandler handler = new AbstractHandler()
|
AbstractHandler handler = new AbstractHandler()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
@ -775,8 +775,15 @@ public class HttpOutputTest
|
||||||
{
|
{
|
||||||
baseRequest.setHandled(true);
|
baseRequest.setHandled(true);
|
||||||
response.setStatus(200);
|
response.setStatus(200);
|
||||||
|
try
|
||||||
|
{
|
||||||
response.getOutputStream().write(new byte[0]);
|
response.getOutputStream().write(new byte[0]);
|
||||||
committed.set(response.isCommitted());
|
committed.succeeded(response.isCommitted());
|
||||||
|
}
|
||||||
|
catch (Throwable t)
|
||||||
|
{
|
||||||
|
committed.failed(t);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -790,7 +797,7 @@ public class HttpOutputTest
|
||||||
@Test
|
@Test
|
||||||
public void testEmptyArrayKnown() throws Exception
|
public void testEmptyArrayKnown() throws Exception
|
||||||
{
|
{
|
||||||
AtomicBoolean committed = new AtomicBoolean();
|
FuturePromise<Boolean> committed = new FuturePromise<>();
|
||||||
AbstractHandler handler = new AbstractHandler()
|
AbstractHandler handler = new AbstractHandler()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
@ -799,8 +806,15 @@ public class HttpOutputTest
|
||||||
baseRequest.setHandled(true);
|
baseRequest.setHandled(true);
|
||||||
response.setStatus(200);
|
response.setStatus(200);
|
||||||
response.setContentLength(0);
|
response.setContentLength(0);
|
||||||
|
try
|
||||||
|
{
|
||||||
response.getOutputStream().write(new byte[0]);
|
response.getOutputStream().write(new byte[0]);
|
||||||
committed.set(response.isCommitted());
|
committed.succeeded(response.isCommitted());
|
||||||
|
}
|
||||||
|
catch (Throwable t)
|
||||||
|
{
|
||||||
|
committed.failed(t);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue