Skip to content

Commit

Permalink
Merge pull request #1011 from muzarski/toolchain_version
Browse files Browse the repository at this point in the history
CI: fix issues related to `[tokio::test]`/`[ntest::timeout]` attributes and tablets with LWT
  • Loading branch information
Lorak-mmk authored Jun 13, 2024
2 parents 4b1eca9 + 032fe2d commit 3d3c353
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 50 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ jobs:
run: |
sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr"
docker compose -f test/cluster/docker-compose.yml up -d --wait
- name: Print rustc version
run: rustc --version
- name: Print rustfmt version
run: cargo fmt --version
- name: Print clippy version
run: cargo clippy --version
- name: Format check
run: cargo fmt --verbose --all -- --check
- name: Clippy check
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/tablets.yml

This file was deleted.

17 changes: 13 additions & 4 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,22 @@ futures = "0.3.6"
openssl = "0.10.32"
rustyline = "9"
rustyline-derive = "0.6"
scylla = {path = "../scylla", features = ["ssl", "cloud", "chrono", "time", "num-bigint-03", "num-bigint-04", "bigdecimal-04"]}
tokio = {version = "1.1.0", features = ["full"]}
tracing = { version = "0.1.25" , features = ["log"] }
scylla = { path = "../scylla", features = [
"ssl",
"cloud",
"chrono",
"time",
"num-bigint-03",
"num-bigint-04",
"bigdecimal-04",
] }
# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed
tokio = { version = ">=1.34, <1.38", features = ["full"] }
tracing = { version = "0.1.25", features = ["log"] }
tracing-subscriber = { version = "0.3.14", features = ["env-filter"] }
chrono = { version = "0.4", default-features = false }
time = { version = "0.3.22" }
uuid = { version = "1.0", features = ["v1"]}
uuid = { version = "1.0", features = ["v1"] }
tower = "0.4"
stats_alloc = "0.1"
clap = { version = "3.2.4", features = ["derive"] }
Expand Down
3 changes: 2 additions & 1 deletion scylla-cql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ license = "MIT OR Apache-2.0"
scylla-macros = { version = "0.5.0", path = "../scylla-macros" }
byteorder = "1.3.4"
bytes = "1.0.1"
tokio = { version = "1.12", features = ["io-util", "time"] }
# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed
tokio = { version = ">=1.34, <1.38", features = ["io-util", "time"] }
secrecy = { version = "0.7.0", optional = true }
snap = "1.0"
uuid = "1.0"
Expand Down
6 changes: 4 additions & 2 deletions scylla-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ scylla-cql = { version = "0.2.0", path = "../scylla-cql" }
byteorder = "1.3.4"
bytes = "1.2.0"
futures = "0.3.6"
tokio = { version = "1.12", features = [
# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed
tokio = { version = ">=1.34, <1.38", features = [
"net",
"time",
"io-util",
Expand All @@ -38,7 +39,8 @@ rand = "0.8.5"
assert_matches = "1.5.0"
ntest = "0.9.0"
tracing-subscriber = { version = "0.3.14", features = ["env-filter"] }
tokio = { version = "1.12", features = ["signal"] }
# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed
tokio = { version = ">=1.34, <1.38", features = ["signal"] }

[lints.rust]
unreachable_pub = "warn"
8 changes: 5 additions & 3 deletions scylla/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ bytes = "1.0.1"
futures = "0.3.6"
hashbrown = "0.14"
histogram = "0.6.9"
tokio = { version = "1.34", features = [
# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed
tokio = { version = ">=1.34, <1.38", features = [
"net",
"time",
"io-util",
Expand Down Expand Up @@ -83,8 +84,9 @@ num-bigint-04 = { package = "num-bigint", version = "0.4" }
bigdecimal-04 = { package = "bigdecimal", version = "0.4" }
scylla-proxy = { version = "0.0.3", path = "../scylla-proxy" }
ntest = "0.9.0"
criterion = "0.4" # Note: v0.5 needs at least rust 1.70.0
tokio = { version = "1.27", features = ["test-util"] }
criterion = "0.4" # Note: v0.5 needs at least rust 1.70.0
# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed
tokio = { version = ">=1.34, <1.38", features = ["test-util"] }
tracing-subscriber = { version = "0.3.14", features = ["env-filter"] }
assert_matches = "1.5.0"
rand_chacha = "0.3.1"
Expand Down
6 changes: 5 additions & 1 deletion scylla/src/transport/session_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2424,7 +2424,11 @@ async fn test_batch_lwts() {
let session = create_new_session_builder().build().await.unwrap();

let ks = unique_keyspace_name();
session.query(format!("CREATE KEYSPACE IF NOT EXISTS {} WITH REPLICATION = {{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1}}", ks), &[]).await.unwrap();
let mut create_ks = format!("CREATE KEYSPACE {} WITH REPLICATION = {{'class': 'NetworkTopologyStrategy', 'replication_factor': 1}}", ks);
if scylla_supports_tablets(&session).await {
create_ks += " and TABLETS = { 'enabled': false}";
}
session.query(create_ks, &[]).await.unwrap();
session.use_keyspace(ks.clone(), false).await.unwrap();

session
Expand Down
7 changes: 6 additions & 1 deletion scylla/tests/integration/lwt_optimisation.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::utils::{setup_tracing, test_with_3_node_cluster};
use scylla::retry_policy::FallthroughRetryPolicy;
use scylla::test_utils::scylla_supports_tablets;
use scylla::test_utils::unique_keyspace_name;
use scylla::transport::session::Session;
use scylla::{ExecutionProfile, SessionBuilder};
Expand Down Expand Up @@ -68,7 +69,11 @@ async fn if_lwt_optimisation_mark_offered_then_negotiatied_and_lwt_routed_optima

// Create schema
let ks = unique_keyspace_name();
session.query(format!("CREATE KEYSPACE IF NOT EXISTS {} WITH REPLICATION = {{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 3}}", ks), &[]).await.unwrap();
let mut create_ks = format!("CREATE KEYSPACE IF NOT EXISTS {} WITH REPLICATION = {{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 3}}", ks);
if scylla_supports_tablets(&session).await {
create_ks += " and TABLETS = { 'enabled': false}";
}
session.query(create_ks, &[]).await.unwrap();
session.use_keyspace(ks, false).await.unwrap();

session
Expand Down
3 changes: 3 additions & 0 deletions scylla/tests/integration/tablets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,12 @@ async fn test_tablet_feedback_not_sent_for_unprepared_queries() {
/// for every tablet.
/// After that it sends 100 queries fro each tablet and verifies that only 1 shard on 1 node
/// recevied requests for a given tablet.
///
/// TODO: Remove #[ignore] once LWTs are supported with tablets.
#[cfg(not(scylla_cloud_tests))]
#[tokio::test]
#[ntest::timeout(30000)]
#[ignore]
async fn test_lwt_optimization_works_with_tablets() {
setup_tracing();
const TABLET_COUNT: usize = 16;
Expand Down

0 comments on commit 3d3c353

Please sign in to comment.