Skip to content

Commit 7f77fd5

Browse files
committed
PS-10166 [8.0]: Stabilize routertest_integration_routing_sharing_restart unit test
1 parent a4355c3 commit 7f77fd5

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

router/tests/integration/test_routing_sharing_restart.cc

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,7 +1510,8 @@ TEST_P(ShareConnectionTestWithRestartedServer,
15101510
auto connect_res = cli.connect(shared_router()->host(),
15111511
shared_router()->port(GetParam()));
15121512
if (!connect_res) {
1513-
if (connect_res.error().value() == 2003) {
1513+
auto err = connect_res.error().value();
1514+
if (err == 2003 || err == 2013) {
15141515
ASSERT_LT(clock_type::now(), end);
15151516

15161517
std::this_thread::sleep_for(200ms);
@@ -1786,16 +1787,12 @@ TEST_P(ShareConnectionTestWithRestartedServer,
17861787
}
17871788

17881789
// fails.
1789-
if (can_share) {
1790-
auto cmd_res = query_one<1>(cli, "SELECT @@port");
1791-
ASSERT_ERROR(cmd_res);
1792-
EXPECT_EQ(cmd_res.error().value(), 2003); // lost
1793-
}
1794-
17951790
{
17961791
auto cmd_res = query_one<1>(cli, "SELECT @@port");
17971792
ASSERT_ERROR(cmd_res);
1798-
EXPECT_EQ(cmd_res.error().value(), 2013); // close
1793+
EXPECT_TRUE(cmd_res.error().value() == 2003 || cmd_res.error().value() == 2013)
1794+
<< "Expected either 2003 (can't connect) or 2013 (lost connection), got "
1795+
<< cmd_res.error().value();
17991796
}
18001797
}
18011798

0 commit comments

Comments
 (0)