Test shard_context on already-created boost::asio::io_service. (#12917)

This commit is contained in:
dHannasch
2020-12-17 15:26:30 -07:00
committed by GitHub
parent c7a59b239f
commit d747071dd9
+9
View File
@@ -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<RedisContext> shard_context =
std::make_shared<RedisContext>(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();
}