Skip to content

Commit

Permalink
Fix client timeout test
Browse files Browse the repository at this point in the history
  • Loading branch information
mcatanzariti authored Dec 2, 2023
1 parent aa9fcf9 commit d2d9ff0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/tests/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,20 @@ async fn on_reconnect() -> Result<()> {
async fn command_timeout() -> Result<()> {
log_try_init();

let mut config = get_default_addr().into_config()?;
config.command_timeout = Duration::from_millis(10);

let client = Client::connect(config).await?;

let client = get_test_client().await?;

client.flushall(FlushingMode::Sync).await?;

// create an empty list
client.lpush("key", "value").await?;
let _result: Vec<String> = client.lpop("key", 1).await?;

client.close().await?;

let mut config = get_default_addr().into_config()?;
config.command_timeout = Duration::from_millis(10);

let client = Client::connect(config).await?;

// block for 5 seconds
// since the timeout is configured to 10ms, we should have a timeout error
Expand Down

0 comments on commit d2d9ff0

Please sign in to comment.