File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
crates/criterion_compat/benches/criterion_integration Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -23,17 +23,19 @@ fn python_fibonacci(c: &mut Criterion) {
2323 . is_ok ( ) ;
2424
2525 if has_python3 {
26- let process = create_command ( )
26+ let mut process = create_command ( )
2727 . stdin ( Stdio :: piped ( ) )
2828 . stdout ( Stdio :: piped ( ) )
2929 . spawn ( )
3030 . expect ( "Unable to start python process" ) ;
3131
3232 let mut stdin = process
3333 . stdin
34+ . take ( )
3435 . expect ( "Unable to get stdin for child process" ) ;
3536 let stdout = process
3637 . stdout
38+ . take ( )
3739 . expect ( "Unable to get stdout for child process" ) ;
3840 let mut stdout = BufReader :: new ( stdout) ;
3941 c. bench_function ( "fibonacci-python" , |b| {
@@ -51,6 +53,9 @@ fn python_fibonacci(c: &mut Criterion) {
5153 } ) ;
5254
5355 // Ensure that your child process terminates itself gracefully!
56+ process
57+ . wait ( )
58+ . expect ( "Child process did not terminate gracefully" ) ;
5459 }
5560}
5661
You can’t perform that action at this time.
0 commit comments