Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky integration test #33604

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ TEST_P(ExtAuthzGrpcIntegrationTest, DownstreamHeadersOnSuccess) {
TEST_P(ExtAuthzGrpcIntegrationTest, TimeoutFailClosed) {
GrpcInitializeConfigOpts opts;
opts.failure_mode_allow = false;
opts.timeout_ms = 10;
opts.timeout_ms = 1;
initializeConfig(opts);

// Use h1, set up the test.
Expand All @@ -1028,9 +1028,6 @@ TEST_P(ExtAuthzGrpcIntegrationTest, TimeoutFailClosed) {
// Start a client connection and request.
initiateClientConnection(0);

// Wait for the ext_authz request as a result of the client request.
waitForExtAuthzRequest(expectedCheckRequest(Http::CodecType::HTTP1));

// Do not sendExtAuthzResponse(). Envoy should reject the request after 1 second.
ASSERT_TRUE(response_->waitForEndStream());
EXPECT_TRUE(response_->complete());
Expand All @@ -1042,7 +1039,7 @@ TEST_P(ExtAuthzGrpcIntegrationTest, TimeoutFailClosed) {
TEST_P(ExtAuthzGrpcIntegrationTest, TimeoutFailOpen) {
GrpcInitializeConfigOpts init_opts;
init_opts.failure_mode_allow = true;
init_opts.timeout_ms = 10;
init_opts.timeout_ms = 1;
initializeConfig(init_opts);

// Use h1, set up the test.
Expand All @@ -1052,9 +1049,6 @@ TEST_P(ExtAuthzGrpcIntegrationTest, TimeoutFailOpen) {
// Start a client connection and request.
initiateClientConnection(0);

// Wait for the ext_authz request as a result of the client request.
waitForExtAuthzRequest(expectedCheckRequest(Http::CodecType::HTTP1));

// Do not sendExtAuthzResponse(). Envoy should eventually proxy the request upstream as if the
// authz service approved the request.
WaitForSuccessfulUpstreamResponseOpts upstream_opts;
Expand Down Expand Up @@ -1273,10 +1267,9 @@ TEST_P(ExtAuthzHttpIntegrationTest, RedirectResponse) {
}

TEST_P(ExtAuthzHttpIntegrationTest, TimeoutFailClosed) {
initializeConfig(false, /*failure_mode_allow=*/false, /*timeout_ms=*/10);
initializeConfig(false, /*failure_mode_allow=*/false, /*timeout_ms=*/1);
HttpIntegrationTest::initialize();
initiateClientConnection();
waitForExtAuthzRequest();

// Do not sendExtAuthzResponse(). Envoy should reject the request after 1 second.
ASSERT_TRUE(response_->waitForEndStream(Envoy::Seconds(10)));
Expand All @@ -1287,10 +1280,9 @@ TEST_P(ExtAuthzHttpIntegrationTest, TimeoutFailClosed) {
}

TEST_P(ExtAuthzHttpIntegrationTest, TimeoutFailOpen) {
initializeConfig(false, /*failure_mode_allow=*/true, /*timeout_ms=*/10);
initializeConfig(false, /*failure_mode_allow=*/true, /*timeout_ms=*/1);
HttpIntegrationTest::initialize();
initiateClientConnection();
waitForExtAuthzRequest();

// Do not sendExtAuthzResponse(). Envoy should eventually proxy the request upstream as if the
// authz service approved the request.
Expand Down