Skip to content

Commit

Permalink
Fix racy test
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed May 17, 2023
1 parent f8c6965 commit da38e59
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/test/java/io/vertx/core/http/HttpTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,11 @@

package io.vertx.core.http;

import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ConnectTimeoutException;
import io.netty.handler.codec.compression.DecompressionException;
import io.netty.handler.codec.http.HttpHeaderNames;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.netty.handler.codec.http2.Http2EventAdapter;
import io.netty.handler.codec.http2.Http2Exception;
import io.netty.handler.codec.http2.Http2Headers;
import io.vertx.codegen.annotations.Nullable;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.AsyncResult;
Expand All @@ -34,7 +30,6 @@
import io.vertx.core.VertxOptions;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.dns.AddressResolverOptions;
import io.vertx.core.http.Http2ServerTest.TestClient;
import io.vertx.core.http.impl.HttpServerRequestInternal;
import io.vertx.core.http.impl.ServerCookie;
import io.vertx.core.http.impl.headers.HeadersMultiMap;
Expand All @@ -55,7 +50,6 @@
import io.vertx.test.netty.TestLoggerFactory;
import io.vertx.test.proxy.HAProxy;
import org.junit.Assume;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
Expand Down Expand Up @@ -6826,8 +6820,9 @@ public void shouldThrowISEIfSendingResponseFromHeadersEndHandler() throws Except
);
startServer(testAddress);
client.request(requestOptions)
.compose(HttpClientRequest::send)
.compose(HttpClientResponse::end)
.compose(req -> req.send()
.andThen(onSuccess(resp -> assertEquals(200, resp.statusCode())))
.compose(HttpClientResponse::end))
.onComplete(onSuccess(nothing -> complete()));
await();
}
Expand Down

0 comments on commit da38e59

Please sign in to comment.