From 5d677ef875598e9dabf7f658affd8c48c16119a0 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Mon, 16 Sep 2024 23:32:51 +0000 Subject: [PATCH] [Flaky] max_connection_age test fix --- test/core/end2end/tests/max_connection_age.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/core/end2end/tests/max_connection_age.cc b/test/core/end2end/tests/max_connection_age.cc index f2d0d88a51b..03252855cf1 100644 --- a/test/core/end2end/tests/max_connection_age.cc +++ b/test/core/end2end/tests/max_connection_age.cc @@ -162,10 +162,12 @@ CORE_END2END_TEST(Http2Test, MaxAgeGracefullyClose) { Expect(101, false); } Step(); - // The connection is closed gracefully with goaway, the rpc should still be - // completed. - EXPECT_EQ(server_status.status(), GRPC_STATUS_UNIMPLEMENTED); - EXPECT_EQ(server_status.message(), "xyz"); + if (got_server) { + // The connection is closed gracefully with goaway, the rpc should still be + // completed. + EXPECT_EQ(server_status.status(), GRPC_STATUS_UNIMPLEMENTED); + EXPECT_EQ(server_status.message(), "xyz"); + } } } // namespace