File tree Expand file tree Collapse file tree 5 files changed +14
-10
lines changed
Expand file tree Collapse file tree 5 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -885,8 +885,7 @@ mod tests {
885885
886886 std:: fs:: write ( & file, "" ) . expect ( "write" ) ;
887887
888- thread:: sleep ( Duration :: from_millis ( 10 ) ) ;
889- // rx.ensure_empty(); // TODO: should unwatch
888+ // rx.ensure_empty_with_wait(); // TODO: should unwatch
890889 }
891890
892891 #[ test]
@@ -1013,8 +1012,7 @@ mod tests {
10131012
10141013 std:: fs:: create_dir ( & path) . expect ( "create_dir2" ) ;
10151014
1016- thread:: sleep ( Duration :: from_millis ( 10 ) ) ;
1017- // rx.ensure_empty(); // TODO: should unwatch
1015+ // rx.ensure_empty_with_wait(); // TODO: should unwatch
10181016 }
10191017
10201018 #[ test]
Original file line number Diff line number Diff line change @@ -1302,7 +1302,7 @@ mod tests {
13021302
13031303 std:: fs:: write ( & file, "" ) . expect ( "write" ) ;
13041304
1305- rx. ensure_empty ( ) ;
1305+ rx. ensure_empty_with_wait ( ) ;
13061306 }
13071307
13081308 #[ test]
@@ -1558,7 +1558,7 @@ mod tests {
15581558
15591559 std:: fs:: create_dir ( & path) . expect ( "create_dir2" ) ;
15601560
1561- rx. ensure_empty ( ) ;
1561+ rx. ensure_empty_with_wait ( ) ;
15621562 }
15631563
15641564 #[ test]
Original file line number Diff line number Diff line change @@ -1025,7 +1025,7 @@ mod tests {
10251025
10261026 std:: fs:: write ( & file, "" ) . expect ( "write" ) ;
10271027
1028- rx. ensure_empty ( ) ;
1028+ rx. ensure_empty_with_wait ( ) ;
10291029 }
10301030
10311031 #[ test]
@@ -1211,7 +1211,7 @@ mod tests {
12111211
12121212 std:: fs:: create_dir ( & path) . expect ( "create_dir2" ) ;
12131213
1214- rx. ensure_empty ( ) ;
1214+ rx. ensure_empty_with_wait ( ) ;
12151215 }
12161216
12171217 #[ test]
Original file line number Diff line number Diff line change @@ -156,6 +156,12 @@ impl Receiver {
156156 }
157157 }
158158
159+ /// Ensures, that the receiver part is empty. It waits for a short period and then checks the channel
160+ pub fn ensure_empty_with_wait ( & mut self ) {
161+ thread:: sleep ( Duration :: from_millis ( 10 ) ) ;
162+ self . ensure_empty ( ) ;
163+ }
164+
159165 /// see [`sleep_until`].
160166 ///
161167 /// it uses timeout from [`Self::timeout`]
Original file line number Diff line number Diff line change @@ -1053,7 +1053,7 @@ pub mod tests {
10531053
10541054 // std::fs::write(&file, "").expect("write");
10551055
1056- // rx.ensure_empty ();
1056+ // rx.ensure_empty_with_wait ();
10571057 }
10581058
10591059 #[ test]
@@ -1284,7 +1284,7 @@ pub mod tests {
12841284
12851285 std:: fs:: create_dir ( & path) . expect ( "create_dir2" ) ;
12861286
1287- rx. ensure_empty ( ) ;
1287+ rx. ensure_empty_with_wait ( ) ;
12881288 }
12891289
12901290 #[ test]
You can’t perform that action at this time.
0 commit comments