Skip to content

Commit 1a9159b

Browse files
committed
TEST/STATS: Account for stats node name cutoff
1 parent dccbc0f commit 1a9159b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/gtest/ucs/test_stats_filter.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,11 @@ UCS_TEST_F(stats_filter_summary, summary) {
264264
break;
265265
}
266266
}
267-
std::string compared_string = std::string(ucs_get_host_name()) + ":" +
268-
ucs::to_string(getpid()) +
267+
268+
std::string node_name = std::string(ucs_get_host_name()) + ":" +
269+
ucs::to_string(getpid());
270+
node_name.resize(std::min<size_t>(node_name.length(), UCS_STAT_NAME_MAX));
271+
std::string compared_string = node_name +
269272
":data*:{counter0:30 counter1:60 " +
270273
"counter2:90 counter3:120} \n";
271274
EXPECT_EQ(compared_string, output);

0 commit comments

Comments
 (0)