Skip to content

Commit fdcc7ef

Browse files
committed
transparent_reprepare it: teardown keyspaces
1 parent ff00d3c commit fdcc7ef

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

scylla/tests/integration/statements/transparent_reprepare.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async fn test_unprepared_reprepare_in_execute() {
3636
let ks = unique_keyspace_name();
3737

3838
session.ddl(format!("CREATE KEYSPACE IF NOT EXISTS {ks} WITH REPLICATION = {{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1}}")).await.unwrap();
39-
session.use_keyspace(ks, false).await.unwrap();
39+
session.use_keyspace(&ks, false).await.unwrap();
4040

4141
session
4242
.ddl("CREATE TABLE IF NOT EXISTS tab (a int, b int, c int, primary key (a, b, c))")
@@ -86,6 +86,8 @@ async fn test_unprepared_reprepare_in_execute() {
8686
.collect();
8787
all_rows.sort_unstable();
8888
assert_eq!(all_rows, vec![(1, 2, 3), (1, 3, 2)]);
89+
90+
session.ddl(format!("DROP KEYSPACE {ks}")).await.unwrap();
8991
}
9092

9193
// A tests which checks that Session::batch automatically reprepares PreparedStatemtns if they become unprepared.
@@ -103,7 +105,7 @@ async fn test_unprepared_reprepare_in_batch() {
103105
let ks = unique_keyspace_name();
104106

105107
session.ddl(format!("CREATE KEYSPACE IF NOT EXISTS {ks} WITH REPLICATION = {{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1}}")).await.unwrap();
106-
session.use_keyspace(ks, false).await.unwrap();
108+
session.use_keyspace(&ks, false).await.unwrap();
107109

108110
session
109111
.ddl("CREATE TABLE IF NOT EXISTS tab (a int, b int, c int, primary key (a, b, c))")
@@ -149,6 +151,8 @@ async fn test_unprepared_reprepare_in_batch() {
149151
.collect();
150152
all_rows.sort_unstable();
151153
assert_eq!(all_rows, vec![(1, 2, 3), (1, 3, 2), (4, 5, 6), (4, 6, 5)]);
154+
155+
session.ddl(format!("DROP KEYSPACE {ks}")).await.unwrap();
152156
}
153157

154158
// A tests which checks that Session::execute automatically reprepares PreparedStatemtns if they become unprepared.
@@ -166,7 +170,7 @@ async fn test_unprepared_reprepare_in_caching_session_execute() {
166170
let ks = unique_keyspace_name();
167171

168172
session.ddl(format!("CREATE KEYSPACE IF NOT EXISTS {ks} WITH REPLICATION = {{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1}}")).await.unwrap();
169-
session.use_keyspace(ks, false).await.unwrap();
173+
session.use_keyspace(&ks, false).await.unwrap();
170174

171175
let caching_session: CachingSession = CachingSession::from(session, 64);
172176

@@ -215,4 +219,9 @@ async fn test_unprepared_reprepare_in_caching_session_execute() {
215219
.collect();
216220
all_rows.sort_unstable();
217221
assert_eq!(all_rows, vec![(1, 2, 3), (1, 3, 2)]);
222+
223+
caching_session
224+
.ddl(format!("DROP KEYSPACE {ks}"))
225+
.await
226+
.unwrap();
218227
}

0 commit comments

Comments
 (0)