mirror of
https://github.com/wassname/ray.git
synced 2026-06-30 16:49:48 +08:00
Test shard_context on already-created boost::asio::io_service. (#12917)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user