From d2d9ff0434ae3985b27e3337ca7fd4ded38164ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Catanzariti?= Date: Sat, 2 Dec 2023 09:47:58 +0100 Subject: [PATCH] Fix client timeout test --- src/tests/client.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/tests/client.rs b/src/tests/client.rs index 4228e41..1721e5a 100644 --- a/src/tests/client.rs +++ b/src/tests/client.rs @@ -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 = 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