@@ -15,8 +15,6 @@ use std::{
15
15
sync:: { Arc , Mutex } ,
16
16
} ;
17
17
18
- #[ cfg( feature = "test" ) ]
19
- use rand:: { thread_rng, Rng } ;
20
18
use tracing_subscriber:: util:: SubscriberInitExt ;
21
19
22
20
pub mod filesource;
@@ -287,7 +285,6 @@ pub struct TestProcess {
287
285
pub cwd : PathBuf ,
288
286
pub args : Vec < String > ,
289
287
pub vars : HashMap < String , String > ,
290
- pub id : u64 ,
291
288
pub stdin : filesource:: TestStdinInner ,
292
289
pub stdout : filesource:: TestWriterInner ,
293
290
pub stderr : filesource:: TestWriterInner ,
@@ -305,20 +302,12 @@ impl TestProcess {
305
302
cwd : cwd. as_ref ( ) . to_path_buf ( ) ,
306
303
args : args. iter ( ) . map ( |s| s. as_ref ( ) . to_string ( ) ) . collect ( ) ,
307
304
vars,
308
- id : TestProcess :: new_id ( ) ,
309
305
stdin : Arc :: new ( Mutex :: new ( Cursor :: new ( stdin. to_string ( ) ) ) ) ,
310
306
stdout : Arc :: new ( Mutex :: new ( Vec :: new ( ) ) ) ,
311
307
stderr : Arc :: new ( Mutex :: new ( Vec :: new ( ) ) ) ,
312
308
}
313
309
}
314
310
315
- fn new_id ( ) -> u64 {
316
- let low_bits: u64 = std:: process:: id ( ) as u64 ;
317
- let mut rng = thread_rng ( ) ;
318
- let high_bits = rng. gen_range ( 0 ..u32:: MAX ) as u64 ;
319
- high_bits << 32 | low_bits
320
- }
321
-
322
311
/// Extracts the stdout from the process
323
312
pub fn get_stdout ( & self ) -> Vec < u8 > {
324
313
self . stdout
0 commit comments