@@ -10,7 +10,7 @@ use std::{
10
10
11
11
use :: metrics:: StatusTimer ;
12
12
use async_broadcast:: Receiver as BroadcastReceiver ;
13
- #[ cfg( any ( test, feature = "testing" ) ) ]
13
+ #[ cfg( test) ]
14
14
use common:: pause:: PauseClient ;
15
15
use common:: {
16
16
codel_queue:: {
@@ -52,7 +52,7 @@ use crate::metrics::{
52
52
log_async_lru_size,
53
53
} ;
54
54
55
- #[ cfg( any ( test, feature = "testing" ) ) ]
55
+ #[ cfg( test) ]
56
56
const PAUSE_DURING_GENERATE_VALUE_LABEL : & str = "generate_value" ;
57
57
58
58
/// A write through cache with support for cancelation.
@@ -79,7 +79,7 @@ pub struct AsyncLru<RT: Runtime, Key, Value> {
79
79
// builds. We shouldn't use tokio locks for prod code (see
80
80
// https://github.com/rust-lang/rust/issues/104883 for background and
81
81
// https://github.com/get-convex/convex/pull/19307 for an alternative).
82
- #[ cfg( any ( test, feature = "testing" ) ) ]
82
+ #[ cfg( test) ]
83
83
pause_client : Option < Arc < tokio:: sync:: Mutex < PauseClient > > > ,
84
84
}
85
85
@@ -91,7 +91,7 @@ impl<RT: Runtime, Key, Value> Clone for AsyncLru<RT, Key, Value> {
91
91
Self {
92
92
inner : self . inner . clone ( ) ,
93
93
label : self . label ,
94
- #[ cfg( any ( test, feature = "testing" ) ) ]
94
+ #[ cfg( test) ]
95
95
pause_client : self . pause_client . clone ( ) ,
96
96
handle : self . handle . clone ( ) ,
97
97
}
@@ -219,12 +219,12 @@ impl<
219
219
max_size,
220
220
concurrency,
221
221
label,
222
- #[ cfg( any ( test, feature = "testing" ) ) ]
222
+ #[ cfg( test) ]
223
223
None ,
224
224
)
225
225
}
226
226
227
- #[ cfg( any ( test, feature = "testing" ) ) ]
227
+ #[ cfg( test) ]
228
228
#[ allow( unused) ]
229
229
fn new_for_tests (
230
230
rt : RT ,
@@ -242,7 +242,7 @@ impl<
242
242
max_size : u64 ,
243
243
concurrency : usize ,
244
244
label : & ' static str ,
245
- #[ cfg( any ( test, feature = "testing" ) ) ] pause_client : Option < PauseClient > ,
245
+ #[ cfg( test) ] pause_client : Option < PauseClient > ,
246
246
) -> Self {
247
247
let ( tx, rx) = new_codel_queue_async ( rt. clone ( ) , 200 ) ;
248
248
let inner = Inner :: new ( cache, max_size, label, tx) ;
@@ -254,7 +254,7 @@ impl<
254
254
inner,
255
255
label,
256
256
handle : Arc :: new ( handle) ,
257
- #[ cfg( any ( test, feature = "testing" ) ) ]
257
+ #[ cfg( test) ]
258
258
pause_client : pause_client
259
259
. map ( |pause_client| Arc :: new ( tokio:: sync:: Mutex :: new ( pause_client) ) ) ,
260
260
}
@@ -386,7 +386,7 @@ impl<
386
386
Status :: Ready ( value) => Ok ( value) ,
387
387
Status :: Waiting ( rx) => Ok ( Self :: wait_for_value ( key, rx) . await ?) ,
388
388
Status :: Kickoff ( rx, timer) => {
389
- #[ cfg( any ( test, feature = "testing" ) ) ]
389
+ #[ cfg( test) ]
390
390
if let Some ( pause_client) = & mut self . pause_client . clone ( ) {
391
391
let pause_client = pause_client. lock ( ) . await ;
392
392
pause_client. wait ( PAUSE_DURING_GENERATE_VALUE_LABEL ) . await ;
0 commit comments