Fixed HttpChannelTest.testOnFailure(). Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
62210d39c2
commit
e481b45cda
|
@ -1220,17 +1220,16 @@ public class HttpChannelTest
|
|||
assertThat(chunk.getFailure(), sameInstance(failure));
|
||||
|
||||
CountDownLatch demand = new CountDownLatch(1);
|
||||
// Demand callback not serialized until after onFailure listeners.
|
||||
// Demand callback is serialized after the onFailure task runs.
|
||||
rq.demand(demand::countDown);
|
||||
assertThat(demand.getCount(), is(0L));
|
||||
assertThat(demand.getCount(), is(1L));
|
||||
|
||||
FuturePromise<Throwable> callback = new FuturePromise<>();
|
||||
// Write callback not serialized until after onFailure listeners.
|
||||
handling.get().write(false, null, Callback.from(() ->
|
||||
{}, callback::succeeded));
|
||||
// Write callback not serialized until after the onFailure task runs.
|
||||
handling.get().write(false, null, Callback.from(() -> {}, callback::succeeded));
|
||||
assertTrue(callback.isDone());
|
||||
|
||||
// Process onFailure task.
|
||||
// Run the onFailure task.
|
||||
try (StacklessLogging ignore = new StacklessLogging(Response.class))
|
||||
{
|
||||
onFailure.run();
|
||||
|
|
Loading…
Reference in New Issue