diff --git a/test/extensions/filters/http/oauth2/oauth_integration_test.cc b/test/extensions/filters/http/oauth2/oauth_integration_test.cc index e8abda8dc409b..8608314fde69f 100644 --- a/test/extensions/filters/http/oauth2/oauth_integration_test.cc +++ b/test/extensions/filters/http/oauth2/oauth_integration_test.cc @@ -471,6 +471,10 @@ name: oauth waitForOAuth2Response(token_secret, expect_failure); if (expect_failure) { + response->waitForHeaders(); + EXPECT_EQ("302", response->headers().getStatusValue()); + RELEASE_ASSERT(response->waitForEndStream(), "unexpected timeout"); + cleanup(); return; }