Skip to content

Commit

Permalink
integration: add a test performing Paxos SELECT
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wprzytula committed Aug 22, 2023
1 parent e697125 commit 86085c5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions scylla/tests/integration/consistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

0 comments on commit 86085c5

Please sign in to comment.