Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
barshaul committed Jun 26, 2024
1 parent 4b18e25 commit 45015d2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion redis/tests/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ impl TestContext {
let millisecond = Duration::from_millis(1);
let mut retries = 0;
loop {
match client.get_connection() {
match client.get_connection(None) {
Err(err) => {
if err.is_connection_refusal() {
sleep(millisecond);
Expand Down
30 changes: 18 additions & 12 deletions redis/tests/test_cluster_scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ mod test_cluster_scan_async {

#[tokio::test]
async fn test_async_cluster_scan() {
let cluster = TestClusterContext::new(3, 0);
let cluster = TestClusterContext::new();
let mut connection = cluster.async_connection(None).await;

// Set some keys
Expand Down Expand Up @@ -88,7 +88,7 @@ mod test_cluster_scan_async {

#[tokio::test] // test cluster scan with slot migration in the middle
async fn test_async_cluster_scan_with_migration() {
let cluster = TestClusterContext::new(3, 0);
let cluster = TestClusterContext::new();

let mut connection = cluster.async_connection(None).await;
// Set some keys
Expand Down Expand Up @@ -163,7 +163,7 @@ mod test_cluster_scan_async {

#[tokio::test] // test cluster scan with node fail in the middle
async fn test_async_cluster_scan_with_fail() {
let cluster = TestClusterContext::new(3, 0);
let cluster = TestClusterContext::new();
let mut connection = cluster.async_connection(None).await;
// Set some keys
for i in 0..1000 {
Expand Down Expand Up @@ -227,8 +227,11 @@ mod test_cluster_scan_async {

#[tokio::test] // Test cluster scan with killing all masters during scan
async fn test_async_cluster_scan_with_all_masters_down() {
let cluster = TestClusterContext::new(6, 1);

let cluster = TestClusterContext::new_with_config(RedisClusterConfiguration {
nodes: 6,
replicas: 1,
..Default::default()
});
let mut connection = cluster.async_connection(None).await;

let mut expected_keys: Vec<String> = Vec::new();
Expand Down Expand Up @@ -373,8 +376,11 @@ mod test_cluster_scan_async {
#[tokio::test]
// Test cluster scan with killing all replicas during scan
async fn test_async_cluster_scan_with_all_replicas_down() {
let cluster = TestClusterContext::new(6, 1);

let cluster = TestClusterContext::new_with_config(RedisClusterConfiguration {
nodes: 6,
replicas: 1,
..Default::default()
});
let mut connection = cluster.async_connection(None).await;

let mut expected_keys: Vec<String> = Vec::new();
Expand Down Expand Up @@ -469,7 +475,7 @@ mod test_cluster_scan_async {
#[tokio::test]
// Test cluster scan with setting keys for each iteration
async fn test_async_cluster_scan_set_in_the_middle() {
let cluster = TestClusterContext::new(3, 0);
let cluster = TestClusterContext::new();
let mut connection = cluster.async_connection(None).await;
let mut expected_keys: Vec<String> = Vec::new();
let mut i = 0;
Expand Down Expand Up @@ -528,7 +534,7 @@ mod test_cluster_scan_async {
#[tokio::test]
// Test cluster scan with deleting keys for each iteration
async fn test_async_cluster_scan_dell_in_the_middle() {
let cluster = TestClusterContext::new(3, 0);
let cluster = TestClusterContext::new();

let mut connection = cluster.async_connection(None).await;
let mut expected_keys: Vec<String> = Vec::new();
Expand Down Expand Up @@ -590,7 +596,7 @@ mod test_cluster_scan_async {
#[tokio::test]
// Testing cluster scan with Pattern option
async fn test_async_cluster_scan_with_pattern() {
let cluster = TestClusterContext::new(3, 0);
let cluster = TestClusterContext::new();
let mut connection = cluster.async_connection(None).await;
let mut expected_keys: Vec<String> = Vec::new();
let mut i = 0;
Expand Down Expand Up @@ -648,7 +654,7 @@ mod test_cluster_scan_async {
#[tokio::test]
// Testing cluster scan with TYPE option
async fn test_async_cluster_scan_with_type() {
let cluster = TestClusterContext::new(3, 0);
let cluster = TestClusterContext::new();
let mut connection = cluster.async_connection(None).await;
let mut expected_keys: Vec<String> = Vec::new();
let mut i = 0;
Expand Down Expand Up @@ -706,7 +712,7 @@ mod test_cluster_scan_async {
#[tokio::test]
// Testing cluster scan with COUNT option
async fn test_async_cluster_scan_with_count() {
let cluster = TestClusterContext::new(3, 0);
let cluster = TestClusterContext::new();
let mut connection = cluster.async_connection(None).await;
let mut expected_keys: Vec<String> = Vec::new();
let mut i = 0;
Expand Down

0 comments on commit 45015d2

Please sign in to comment.