Skip to content

Commit

Permalink
traffic-resilience-http: extend connect timeout for CI even further
Browse files Browse the repository at this point in the history
Motivation:

Even 4 seconds added in #3077 seems too low for CI. Trying higher value.
Also, we can reuse already existing `CI` constant.
  • Loading branch information
idelpivnitskiy committed Oct 15, 2024
1 parent 75e67fb commit 48e9ed8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import io.servicetalk.concurrent.api.Executors;
import io.servicetalk.concurrent.api.Publisher;
import io.servicetalk.concurrent.api.Single;
import io.servicetalk.concurrent.internal.TestTimeoutConstants;
import io.servicetalk.http.api.FilterableStreamingHttpConnection;
import io.servicetalk.http.api.HttpLifecycleObserver;
import io.servicetalk.http.api.HttpProtocolConfig;
Expand Down Expand Up @@ -83,7 +84,6 @@
import static io.servicetalk.transport.netty.internal.AddressUtils.localAddress;
import static io.servicetalk.transport.netty.internal.AddressUtils.serverHostAndPort;
import static io.servicetalk.utils.internal.ThrowableUtils.throwException;
import static java.lang.Boolean.parseBoolean;
import static java.lang.Thread.NORM_PRIORITY;
import static java.nio.charset.StandardCharsets.US_ASCII;
import static java.util.Objects.requireNonNull;
Expand Down Expand Up @@ -235,7 +235,7 @@ Single<HttpServerContext> listen(HttpServerBuilder builder) {
}

void ignoreTestWhen(ExecutorSupplier clientExecutorSupplier, ExecutorSupplier serverExecutorSupplier) {
assumeFalse(parseBoolean(System.getenv("CI")) &&
assumeFalse(TestTimeoutConstants.CI &&
this.clientExecutorSupplier == clientExecutorSupplier &&
this.serverExecutorSupplier == serverExecutorSupplier,
"Ignored flaky test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import static io.servicetalk.capacity.limiter.api.CapacityLimiters.fixedCapacity;
import static io.servicetalk.concurrent.api.Single.succeeded;
import static io.servicetalk.concurrent.internal.DeliberateException.DELIBERATE_EXCEPTION;
import static io.servicetalk.concurrent.internal.TestTimeoutConstants.CI;
import static io.servicetalk.http.netty.AsyncContextHttpFilterVerifier.verifyServerFilterAsyncContextVisibility;
import static io.servicetalk.http.netty.HttpProtocolConfigs.h1Default;
import static io.servicetalk.http.netty.HttpProtocolConfigs.h2Default;
Expand All @@ -57,7 +58,6 @@
import static io.servicetalk.transport.api.ServiceTalkSocketOptions.SO_BACKLOG;
import static io.servicetalk.transport.netty.internal.AddressUtils.localAddress;
import static io.servicetalk.transport.netty.internal.AddressUtils.serverHostAndPort;
import static java.lang.Boolean.parseBoolean;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
Expand All @@ -75,8 +75,6 @@ class TrafficResilienceHttpServiceFilterTest {

private static final boolean IS_LINUX = "linux".equals(normalizedOs());

private static final boolean CI = parseBoolean(System.getenv("CI"));

// There is an off-by-one behavior difference between macOS & Linux.
// Linux has a greater-than check
// (see. https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/include/net/sock.h#L941)
Expand Down Expand Up @@ -172,7 +170,7 @@ void testStopAcceptingConnections(final Protocol protocol) throws Exception {

final StreamingHttpClient client = HttpClients.forSingleAddress(serverHostAndPort(serverContext))
.protocols(protocol.config)
.socketOption(CONNECT_TIMEOUT, (int) SECONDS.toMillis(CI ? 4 : 2))
.socketOption(CONNECT_TIMEOUT, (int) SECONDS.toMillis(CI ? 8 : 2))
.buildStreaming();

// First request -> Pending 1
Expand Down

0 comments on commit 48e9ed8

Please sign in to comment.