From b933939ca0d425168a2b28af6a2264566acac2de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Przytu=C5=82a?= Date: Mon, 21 Aug 2023 12:35:11 +0200 Subject: [PATCH] integration: add a test performing Paxos SELECT The test stays there to assert that it is expressible and possible to perform such a query. Before, Consistency did not contain serial variants, so it used to not be feasible, even though supported by Scylla. --- scylla/tests/integration/consistency.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scylla/tests/integration/consistency.rs b/scylla/tests/integration/consistency.rs index 41c32c732b..9eaabf0304 100644 --- a/scylla/tests/integration/consistency.rs +++ b/scylla/tests/integration/consistency.rs @@ -452,3 +452,24 @@ async fn consistency_is_correctly_set_in_routing_info() { ) .await; } + +// Performs a read using Paxos, by setting Consistency to Serial. +// This not really checks that functionality works properly, but stays here +// to ensure that it is even expressible to issue such query. +// Before, Consistency did not contain serial variants, so it used to be impossible. +#[tokio::test] +#[ntest::timeout(60000)] +#[cfg(not(scylla_cloud_tests))] +async fn consistency_allows_for_paxos_selects() { + let uri = std::env::var("SCYLLA_URI").unwrap_or_else(|_| "127.0.0.1:9042".to_string()); + + let session = SessionBuilder::new() + .known_node(uri.as_str()) + .build() + .await + .unwrap(); + + let mut query = Query::from("SELECT host_id FROM system.peers WHERE peer = '127.0.0.1'"); + query.set_consistency(Consistency::Serial); + session.query(query, ()).await.unwrap(); +}