Skip to content

Commit

Permalink
Removed retries from cluster scan tests to make them faster
Browse files Browse the repository at this point in the history
  • Loading branch information
barshaul committed Aug 15, 2024
1 parent 1bd3f08 commit 5525ad0
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions redis/tests/test_cluster_scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,12 @@ 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_with_cluster_client_builder(
3,
0,
|builder| builder.retries(0),
false,
);
let mut connection = cluster.async_connection(None).await;
// Set some keys
for i in 0..1000 {
Expand Down Expand Up @@ -224,7 +229,11 @@ mod test_cluster_scan_async {
let cluster = TestClusterContext::new_with_cluster_client_builder(
6,
1,
|builder| builder.slots_refresh_rate_limit(Duration::from_secs(0), 0),
|builder| {
builder
.slots_refresh_rate_limit(Duration::from_secs(0), 0)
.retries(0)
},
false,
);

Expand Down Expand Up @@ -374,7 +383,11 @@ mod test_cluster_scan_async {
let cluster = TestClusterContext::new_with_cluster_client_builder(
6,
1,
|builder| builder.slots_refresh_rate_limit(Duration::from_secs(0), 0),
|builder| {
builder
.slots_refresh_rate_limit(Duration::from_secs(0), 0)
.retries(0)
},
false,
);

Expand Down Expand Up @@ -772,7 +785,12 @@ mod test_cluster_scan_async {
// Testing cluster scan when connection fails in the middle and we get an error
// then cluster up again and scanning can continue without any problem
async fn test_async_cluster_scan_failover() {
let mut cluster = TestClusterContext::new(3, 0);
let mut cluster = TestClusterContext::new_with_cluster_client_builder(
3,
0,
|builder| builder.retries(0),
false,
);
let mut connection = cluster.async_connection(None).await;
let mut i = 0;
loop {
Expand Down

0 comments on commit 5525ad0

Please sign in to comment.