@@ -101,7 +101,7 @@ async fn custom_spin_key_value_works() -> anyhow::Result<()> {
101101
102102#[ tokio:: test( flavor = "multi_thread" , worker_threads = 1 ) ]
103103async 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" ) ?;
105105 let db_path = tmp_dir. path ( ) . join ( "foo/custom.db" ) ;
106106 // Check that the db does not exist yet - it will exist by the end of the test
107107 assert ! ( !db_path. exists( ) ) ;
@@ -132,7 +132,7 @@ async fn custom_spin_key_value_works_with_absolute_path() -> anyhow::Result<()>
132132
133133#[ tokio:: test( flavor = "multi_thread" , worker_threads = 1 ) ]
134134async 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" ) ?;
136136 let db_path = tmp_dir. path ( ) . join ( "custom.db" ) ;
137137 // Check that the db does not exist yet - it will exist by the end of the test
138138 assert ! ( !db_path. exists( ) ) ;
@@ -176,7 +176,7 @@ async fn custom_redis_key_value_works() -> anyhow::Result<()> {
176176
177177#[ tokio:: test]
178178async 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" ) ?;
180180 let runtime_config = toml:: toml! {
181181 [ key_value_store. custom]
182182 type = "spin"
@@ -198,7 +198,7 @@ async fn misconfigured_spin_key_value_fails() -> anyhow::Result<()> {
198198// TODO(rylev): consider removing this test as it is really only a consequence of
199199// toml deserialization and not a feature of the key-value store.
200200async 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" ) ?;
202202 let db_path = tmp_dir. path ( ) . join ( "custom.db" ) ;
203203 // Check that the db does not exist yet - it will exist by the end of the test
204204 assert ! ( !db_path. exists( ) ) ;
0 commit comments