@@ -36,10 +36,10 @@ fn test_incremental_file(io_threads: &str) -> Result<()> {
3636 0o666 ,
3737 io_executor. incremental_file_state ( ) ,
3838 ) ?;
39- for _ in io_executor . execute ( item ) . collect :: < Vec < _ > > ( ) {
40- // The file should be open and incomplete, and no completed chunks
41- unreachable ! ( ) ;
42- }
39+
40+ // The file should be open and incomplete, and no completed chunks
41+ assert ! ( io_executor . execute ( item ) . collect :: < Vec <_>> ( ) . is_empty ( ) ) ;
42+
4343 let mut chunk = io_executor. get_buffer ( super :: IO_CHUNK_SIZE ) ;
4444 chunk. extend ( b"0123456789" ) ;
4545 chunk = chunk. finished ( ) ;
@@ -76,13 +76,12 @@ fn test_incremental_file(io_threads: &str) -> Result<()> {
7676 break ;
7777 }
7878 }
79- assert ! ( file_finished) ;
80- for _ in io_executor. join ( ) . collect :: < Vec < _ > > ( ) {
81- // no more work should be outstanding
82- unreachable ! ( ) ;
83- }
8479
80+ // no more work should be outstanding
81+ assert ! ( file_finished) ;
82+ assert ! ( io_executor. join( ) . collect:: <Vec <_>>( ) . is_empty( ) ) ;
8583 assert_eq ! ( io_executor. buffer_used( ) , 0 ) ;
84+
8685 Ok ( ( ) )
8786 } ) ?;
8887 // We should be able to read back the file
@@ -143,10 +142,9 @@ fn test_complete_file(io_threads: &str) -> Result<()> {
143142 }
144143 }
145144 assert ! ( items > 0 ) ;
146- for _ in io_executor. join ( ) . collect :: < Vec < _ > > ( ) {
147- // no more work should be outstanding
148- unreachable ! ( ) ;
149- }
145+ // no more work should be outstanding
146+ assert ! ( io_executor. join( ) . collect:: <Vec <_>>( ) . is_empty( ) ) ;
147+
150148 Ok ( ( ) )
151149 } ) ?;
152150 // We should be able to read back the file with correct content
0 commit comments