Skip to content

Commit

Permalink
Update redis-rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Jan 10, 2024
1 parent 8740efb commit 1afe4f9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 18 deletions.
29 changes: 22 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ serde = { version = "1.0.111", features = ["derive"] }
serde_yaml = "0.9.17"
uuid = { version = "1.0.0", features = ["serde", "v4"] }
reqwest = "0.11.6"
redis = { version = "0.23.3", features = ["tokio-comp", "cluster"] }
redis = { version = "0.24.0", features = ["tokio-comp", "cluster"] }
cdrs-tokio = "8.0"
cassandra-protocol = "3.0"
tracing = "0.1.15"
Expand Down
14 changes: 6 additions & 8 deletions shotover-proxy/tests/redis_int_tests/basic_driver_tests.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use crate::redis_int_tests::assert::*;
use bytes::BytesMut;
use fred::clients::RedisClient;
use fred::interfaces::KeysInterface;
use futures::{Future, StreamExt};
use rand::{thread_rng, Rng};
use rand_distr::Alphanumeric;
Expand Down Expand Up @@ -1265,15 +1267,11 @@ pub async fn test_dr_auth() {

/// A driver variant of this test case is provided so that we can ensure that
/// at least one driver handles this as we expect.
pub async fn test_trigger_transform_failure_driver(connection: &mut Connection) {
/// Fred is used here as redis-rs sends an unconfigurable `CLIENT SETINFO` command and ignores the result on connection init.
/// This results in the error message being completely dropped.
pub async fn test_trigger_transform_failure_driver(client: &RedisClient) {
assert_eq!(
redis::cmd("SET")
.arg("foo")
.arg(42)
.query_async::<_, ()>(connection)
.await
.unwrap_err()
.to_string(),
client.set::<(), _, _>("foo", 42, None, None, false).await.unwrap_err().details(),
"An error was signalled by the server - ResponseError: Internal shotover (or custom transform) bug: Chain failed to send and/or receive messages, the connection will now be closed. Caused by: 0: RedisSinkSingle transform failed 1: Failed to connect to destination \"127.0.0.1:1111\" 2: Connection refused (os error 111)".to_string()
);
}
Expand Down
11 changes: 9 additions & 2 deletions shotover-proxy/tests/redis_int_tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use crate::shotover_process;
use basic_driver_tests::*;
use fred::clients::RedisClient;
use fred::interfaces::ClientLike;
use fred::types::RedisConfig;
use redis::aio::Connection;
use redis::Commands;

Expand Down Expand Up @@ -47,9 +50,13 @@ async fn passthrough_redis_down() {
let shotover = shotover_process("tests/test-configs/redis/passthrough/topology.yaml")
.start()
.await;
let mut connection = redis_connection::new_async("127.0.0.1", 6379).await;
let client = RedisClient::new(RedisConfig::default(), None, None, None);

test_trigger_transform_failure_driver(&mut connection).await;
{
let _shutdown_handle = client.connect();
client.wait_for_connect().await.unwrap();
test_trigger_transform_failure_driver(&client).await;
}
test_trigger_transform_failure_raw().await;

test_invalid_frame().await;
Expand Down

0 comments on commit 1afe4f9

Please sign in to comment.