diff --git a/src/ray/stats/stats_test.cc b/src/ray/stats/stats_test.cc index 43c8a9b94..66c09f643 100644 --- a/src/ray/stats/stats_test.cc +++ b/src/ray/stats/stats_test.cc @@ -41,11 +41,12 @@ class MockExporter : public opencensus::stats::StatsExporter::Handler { ASSERT_EQ("current_worker", descriptor.name()); ASSERT_EQ(opencensus::stats::ViewData::Type::kDouble, view_data.type()); - for (const auto row : view_data.double_data()) { for (size_t i = 0; i < descriptor.columns().size(); ++i) { - if (descriptor.columns()[i].name() == "NodeAddress") { - ASSERT_EQ("Localhost", row.first[i]); + if (descriptor.columns()[i].name() == "WorkerPidKey") { + ASSERT_EQ("1000", row.first[i]); + } else if (descriptor.columns()[i].name() == "LanguageKey") { + ASSERT_EQ("CPP", row.first[i]); } } // row.second store the data of this metric. @@ -58,7 +59,9 @@ class MockExporter : public opencensus::stats::StatsExporter::Handler { class StatsTest : public ::testing::Test { public: void SetUp() { - ray::stats::Init("127.0.0.1:8888", {{stats::NodeAddressKey, "Localhost"}}, false); + const stats::TagsType global_tags = {{stats::LanguageKey, "CPP"}, + {stats::WorkerPidKey, "1000"}}; + ray::stats::Init("127.0.0.1:8888", global_tags, false); MockExporter::Register(); }