From d747071dd9e883bd4ceefe80d0344f287630c4e5 Mon Sep 17 00:00:00 2001 From: dHannasch Date: Thu, 17 Dec 2020 15:26:30 -0700 Subject: [PATCH] Test shard_context on already-created boost::asio::io_service. (#12917) --- src/ray/gcs/test/asio_test.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ray/gcs/test/asio_test.cc b/src/ray/gcs/test/asio_test.cc index 5883ca661..052a95ec6 100644 --- a/src/ray/gcs/test/asio_test.cc +++ b/src/ray/gcs/test/asio_test.cc @@ -18,6 +18,7 @@ #include "gtest/gtest.h" #include "ray/common/test_util.h" +#include "ray/gcs/redis_context.h" #include "ray/util/logging.h" extern "C" { @@ -66,6 +67,14 @@ TEST_F(RedisAsioTest, TestRedisCommands) { redisAsyncCommand(ac, NULL, NULL, "SET key test"); redisAsyncCommand(ac, GetCallback, nullptr, "GET key"); + std::shared_ptr shard_context = + std::make_shared(io_service); + ASSERT_TRUE(shard_context + ->Connect(std::string("127.0.0.1"), TEST_REDIS_SERVER_PORTS.front(), + /*sharding=*/true, + /*password=*/std::string()) + .ok()); + io_service.run(); }