@@ -101,7 +101,7 @@ async fn custom_spin_key_value_works() -> anyhow::Result<()> {
101
101
102
102
#[ tokio:: test( flavor = "multi_thread" , worker_threads = 1 ) ]
103
103
async fn custom_spin_key_value_works_with_absolute_path ( ) -> anyhow:: Result < ( ) > {
104
- let tmp_dir = tempdir :: TempDir :: new ( "example" ) ?;
104
+ let tmp_dir = tempfile :: TempDir :: with_prefix ( "example" ) ?;
105
105
let db_path = tmp_dir. path ( ) . join ( "foo/custom.db" ) ;
106
106
// Check that the db does not exist yet - it will exist by the end of the test
107
107
assert ! ( !db_path. exists( ) ) ;
@@ -132,7 +132,7 @@ async fn custom_spin_key_value_works_with_absolute_path() -> anyhow::Result<()>
132
132
133
133
#[ tokio:: test( flavor = "multi_thread" , worker_threads = 1 ) ]
134
134
async fn custom_spin_key_value_works_with_relative_path ( ) -> anyhow:: Result < ( ) > {
135
- let tmp_dir = tempdir :: TempDir :: new ( "example" ) ?;
135
+ let tmp_dir = tempfile :: TempDir :: with_prefix ( "example" ) ?;
136
136
let db_path = tmp_dir. path ( ) . join ( "custom.db" ) ;
137
137
// Check that the db does not exist yet - it will exist by the end of the test
138
138
assert ! ( !db_path. exists( ) ) ;
@@ -176,7 +176,7 @@ async fn custom_redis_key_value_works() -> anyhow::Result<()> {
176
176
177
177
#[ tokio:: test]
178
178
async fn misconfigured_spin_key_value_fails ( ) -> anyhow:: Result < ( ) > {
179
- let tmp_dir = tempdir :: TempDir :: new ( "example" ) ?;
179
+ let tmp_dir = tempfile :: TempDir :: with_prefix ( "example" ) ?;
180
180
let runtime_config = toml:: toml! {
181
181
[ key_value_store. custom]
182
182
type = "spin"
@@ -198,7 +198,7 @@ async fn misconfigured_spin_key_value_fails() -> anyhow::Result<()> {
198
198
// TODO(rylev): consider removing this test as it is really only a consequence of
199
199
// toml deserialization and not a feature of the key-value store.
200
200
async fn multiple_custom_key_value_uses_second_store ( ) -> anyhow:: Result < ( ) > {
201
- let tmp_dir = tempdir :: TempDir :: new ( "example" ) ?;
201
+ let tmp_dir = tempfile :: TempDir :: with_prefix ( "example" ) ?;
202
202
let db_path = tmp_dir. path ( ) . join ( "custom.db" ) ;
203
203
// Check that the db does not exist yet - it will exist by the end of the test
204
204
assert ! ( !db_path. exists( ) ) ;
0 commit comments