From ec5cf68e74b5d43e7d11d629b6fcfe53767ea703 Mon Sep 17 00:00:00 2001 From: samuel orji Date: Tue, 10 Oct 2023 19:24:20 +0100 Subject: [PATCH] review feedback: add request timeout to execution profile to enable that writes complete during cassandra tests --- .../transport/large_batch_statements_test.rs | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/scylla/src/transport/large_batch_statements_test.rs b/scylla/src/transport/large_batch_statements_test.rs index b2a5e8eaf0..7d08ea78f2 100644 --- a/scylla/src/transport/large_batch_statements_test.rs +++ b/scylla/src/transport/large_batch_statements_test.rs @@ -1,3 +1,7 @@ +use assert_matches::assert_matches; + +use scylla_cql::errors::{BadQuery, QueryError}; + use crate::batch::BatchType; use crate::query::Query; use crate::{ @@ -5,27 +9,14 @@ use crate::{ test_utils::{create_new_session_builder, unique_keyspace_name}, QueryResult, Session, }; -use assert_matches::assert_matches; -use scylla_cql::errors::{BadQuery, DbError, QueryError}; #[tokio::test] async fn test_large_batch_statements() { let mut session = create_new_session_builder().build().await.unwrap(); + let ks = unique_keyspace_name(); session = create_test_session(session, &ks).await; - // Add batch - let max_number_of_queries = u16::MAX as usize; - let batch_result = write_batch(&session, max_number_of_queries, &ks).await; - - if batch_result.is_err() { - assert_matches!( - batch_result.unwrap_err(), - QueryError::DbError(DbError::WriteTimeout { .. }, _) - ) - } - - // Now try with too many queries let too_many_queries = u16::MAX as usize + 1; let batch_insert_result = write_batch(&session, too_many_queries, &ks).await; assert_matches!(