Skip to content

Commit

Permalink
Attempt to fix another failing test
Browse files Browse the repository at this point in the history
'grant SELECT(number) ON system.numbers'
  • Loading branch information
Enmk committed Feb 28, 2024
1 parent e21c445 commit f2fcddf
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions ut/client_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1159,24 +1159,31 @@ TEST_P(ClientCase, OnProfileEvents) {
}

TEST_P(ClientCase, OnProfile) {
Query query("SELECT * FROM system.numbers LIMIT 10;");
try {
Query query("SELECT * FROM system.numbers LIMIT 10;");

std::optional<Profile> profile;
query.OnProfile([&profile](const Profile & new_profile) {
profile = new_profile;
});
std::optional<Profile> profile;
query.OnProfile([&profile](const Profile & new_profile) {
profile = new_profile;
});

client_->Execute(query);
client_->Execute(query);

// Make sure that profile event came through
ASSERT_NE(profile, std::nullopt);
// Make sure that profile event came through
ASSERT_NE(profile, std::nullopt);

EXPECT_GE(profile->rows, 10u);
EXPECT_GE(profile->blocks, 1u);
EXPECT_GT(profile->bytes, 1u);
EXPECT_GE(profile->rows_before_limit, 10u);
EXPECT_EQ(profile->applied_limit, true);
EXPECT_EQ(profile->calculated_rows_before_limit, true);
EXPECT_GE(profile->rows, 10u);
EXPECT_GE(profile->blocks, 1u);
EXPECT_GT(profile->bytes, 1u);
EXPECT_GE(profile->rows_before_limit, 10u);
EXPECT_EQ(profile->applied_limit, true);
EXPECT_EQ(profile->calculated_rows_before_limit, true);
} catch (const clickhouse::ServerError & e) {
if (e.GetCode() == ErrorCodes::ACCESS_DENIED)
GTEST_SKIP() << e.what() << " : " << GetParam();
else
throw;
}
}

TEST_P(ClientCase, SelectAggregateFunction) {
Expand Down

0 comments on commit f2fcddf

Please sign in to comment.