Skip to content

Commit 3d3c353

Browse files
authored
Merge pull request #1011 from muzarski/toolchain_version
CI: fix issues related to `[tokio::test]`/`[ntest::timeout]` attributes and tablets with LWT
2 parents 4b1eca9 + 032fe2d commit 3d3c353

File tree

9 files changed

+44
-50
lines changed

9 files changed

+44
-50
lines changed

.github/workflows/rust.yml

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ jobs:
2626
run: |
2727
sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr"
2828
docker compose -f test/cluster/docker-compose.yml up -d --wait
29+
- name: Print rustc version
30+
run: rustc --version
31+
- name: Print rustfmt version
32+
run: cargo fmt --version
33+
- name: Print clippy version
34+
run: cargo clippy --version
2935
- name: Format check
3036
run: cargo fmt --verbose --all -- --check
3137
- name: Clippy check

.github/workflows/tablets.yml

-38
This file was deleted.

examples/Cargo.toml

+13-4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,22 @@ futures = "0.3.6"
1010
openssl = "0.10.32"
1111
rustyline = "9"
1212
rustyline-derive = "0.6"
13-
scylla = {path = "../scylla", features = ["ssl", "cloud", "chrono", "time", "num-bigint-03", "num-bigint-04", "bigdecimal-04"]}
14-
tokio = {version = "1.1.0", features = ["full"]}
15-
tracing = { version = "0.1.25" , features = ["log"] }
13+
scylla = { path = "../scylla", features = [
14+
"ssl",
15+
"cloud",
16+
"chrono",
17+
"time",
18+
"num-bigint-03",
19+
"num-bigint-04",
20+
"bigdecimal-04",
21+
] }
22+
# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed
23+
tokio = { version = ">=1.34, <1.38", features = ["full"] }
24+
tracing = { version = "0.1.25", features = ["log"] }
1625
tracing-subscriber = { version = "0.3.14", features = ["env-filter"] }
1726
chrono = { version = "0.4", default-features = false }
1827
time = { version = "0.3.22" }
19-
uuid = { version = "1.0", features = ["v1"]}
28+
uuid = { version = "1.0", features = ["v1"] }
2029
tower = "0.4"
2130
stats_alloc = "0.1"
2231
clap = { version = "3.2.4", features = ["derive"] }

scylla-cql/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ license = "MIT OR Apache-2.0"
1313
scylla-macros = { version = "0.5.0", path = "../scylla-macros" }
1414
byteorder = "1.3.4"
1515
bytes = "1.0.1"
16-
tokio = { version = "1.12", features = ["io-util", "time"] }
16+
# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed
17+
tokio = { version = ">=1.34, <1.38", features = ["io-util", "time"] }
1718
secrecy = { version = "0.7.0", optional = true }
1819
snap = "1.0"
1920
uuid = "1.0"

scylla-proxy/Cargo.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ scylla-cql = { version = "0.2.0", path = "../scylla-cql" }
1717
byteorder = "1.3.4"
1818
bytes = "1.2.0"
1919
futures = "0.3.6"
20-
tokio = { version = "1.12", features = [
20+
# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed
21+
tokio = { version = ">=1.34, <1.38", features = [
2122
"net",
2223
"time",
2324
"io-util",
@@ -38,7 +39,8 @@ rand = "0.8.5"
3839
assert_matches = "1.5.0"
3940
ntest = "0.9.0"
4041
tracing-subscriber = { version = "0.3.14", features = ["env-filter"] }
41-
tokio = { version = "1.12", features = ["signal"] }
42+
# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed
43+
tokio = { version = ">=1.34, <1.38", features = ["signal"] }
4244

4345
[lints.rust]
4446
unreachable_pub = "warn"

scylla/Cargo.toml

+5-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ bytes = "1.0.1"
4747
futures = "0.3.6"
4848
hashbrown = "0.14"
4949
histogram = "0.6.9"
50-
tokio = { version = "1.34", features = [
50+
# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed
51+
tokio = { version = ">=1.34, <1.38", features = [
5152
"net",
5253
"time",
5354
"io-util",
@@ -83,8 +84,9 @@ num-bigint-04 = { package = "num-bigint", version = "0.4" }
8384
bigdecimal-04 = { package = "bigdecimal", version = "0.4" }
8485
scylla-proxy = { version = "0.0.3", path = "../scylla-proxy" }
8586
ntest = "0.9.0"
86-
criterion = "0.4" # Note: v0.5 needs at least rust 1.70.0
87-
tokio = { version = "1.27", features = ["test-util"] }
87+
criterion = "0.4" # Note: v0.5 needs at least rust 1.70.0
88+
# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed
89+
tokio = { version = ">=1.34, <1.38", features = ["test-util"] }
8890
tracing-subscriber = { version = "0.3.14", features = ["env-filter"] }
8991
assert_matches = "1.5.0"
9092
rand_chacha = "0.3.1"

scylla/src/transport/session_test.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -2424,7 +2424,11 @@ async fn test_batch_lwts() {
24242424
let session = create_new_session_builder().build().await.unwrap();
24252425

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

24302434
session

scylla/tests/integration/lwt_optimisation.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::utils::{setup_tracing, test_with_3_node_cluster};
22
use scylla::retry_policy::FallthroughRetryPolicy;
3+
use scylla::test_utils::scylla_supports_tablets;
34
use scylla::test_utils::unique_keyspace_name;
45
use scylla::transport::session::Session;
56
use scylla::{ExecutionProfile, SessionBuilder};
@@ -68,7 +69,11 @@ async fn if_lwt_optimisation_mark_offered_then_negotiatied_and_lwt_routed_optima
6869

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

7479
session

scylla/tests/integration/tablets.rs

+3
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,12 @@ async fn test_tablet_feedback_not_sent_for_unprepared_queries() {
479479
/// for every tablet.
480480
/// After that it sends 100 queries fro each tablet and verifies that only 1 shard on 1 node
481481
/// recevied requests for a given tablet.
482+
///
483+
/// TODO: Remove #[ignore] once LWTs are supported with tablets.
482484
#[cfg(not(scylla_cloud_tests))]
483485
#[tokio::test]
484486
#[ntest::timeout(30000)]
487+
#[ignore]
485488
async fn test_lwt_optimization_works_with_tablets() {
486489
setup_tracing();
487490
const TABLET_COUNT: usize = 16;

0 commit comments

Comments
 (0)