@@ -940,7 +940,7 @@ mod dispatch_impl {
940
940
let ( closes_tx, closes) = mpsc:: channel ( 10 ) ;
941
941
942
942
let ( tx1, rx1) = oneshot:: channel ( ) ;
943
- let ( _client_drop_tx, client_drop_rx) = oneshot :: channel :: < ( ) > ( ) ;
943
+ let ( _client_drop_tx, client_drop_rx) = std :: sync :: mpsc :: channel :: < ( ) > ( ) ;
944
944
945
945
thread:: spawn ( move || {
946
946
let mut sock = server. accept ( ) . unwrap ( ) . 0 ;
@@ -954,7 +954,7 @@ mod dispatch_impl {
954
954
955
955
// prevent this thread from closing until end of test, so the connection
956
956
// stays open and idle until Client is dropped
957
- Runtime :: new ( ) . unwrap ( ) . block_on ( client_drop_rx. into_future ( ) ) . unwrap ( ) ;
957
+ let _ = client_drop_rx. recv ( ) ;
958
958
} ) ;
959
959
960
960
let res = {
@@ -989,7 +989,7 @@ mod dispatch_impl {
989
989
let ( closes_tx, closes) = mpsc:: channel ( 10 ) ;
990
990
991
991
let ( tx1, rx1) = oneshot:: channel ( ) ;
992
- let ( _client_drop_tx, client_drop_rx) = oneshot :: channel :: < ( ) > ( ) ;
992
+ let ( _client_drop_tx, client_drop_rx) = std :: sync :: mpsc :: channel :: < ( ) > ( ) ;
993
993
994
994
thread:: spawn ( move || {
995
995
let mut sock = server. accept ( ) . unwrap ( ) . 0 ;
@@ -1002,7 +1002,7 @@ mod dispatch_impl {
1002
1002
1003
1003
// prevent this thread from closing until end of test, so the connection
1004
1004
// stays open and idle until Client is dropped
1005
- Runtime :: new ( ) . unwrap ( ) . block_on ( client_drop_rx. into_future ( ) ) . unwrap ( ) ;
1005
+ let _ = client_drop_rx. recv ( ) ;
1006
1006
} ) ;
1007
1007
1008
1008
let res = {
@@ -1039,7 +1039,7 @@ mod dispatch_impl {
1039
1039
let ( closes_tx, closes) = mpsc:: channel ( 10 ) ;
1040
1040
1041
1041
let ( tx1, rx1) = oneshot:: channel ( ) ;
1042
- let ( _tx2, rx2) = oneshot :: channel :: < ( ) > ( ) ;
1042
+ let ( _tx2, rx2) = std :: sync :: mpsc :: channel :: < ( ) > ( ) ;
1043
1043
1044
1044
thread:: spawn ( move || {
1045
1045
let mut sock = server. accept ( ) . unwrap ( ) . 0 ;
@@ -1049,7 +1049,10 @@ mod dispatch_impl {
1049
1049
sock. read ( & mut buf) . expect ( "read 1" ) ;
1050
1050
sock. write_all ( b"HTTP/1.1 200 OK\r \n Content-Length: 0\r \n \r \n " ) . unwrap ( ) ;
1051
1051
let _ = tx1. send ( ( ) ) ;
1052
- let _ = Runtime :: new ( ) . unwrap ( ) . block_on ( rx2) . unwrap ( ) ;
1052
+
1053
+ // prevent this thread from closing until end of test, so the connection
1054
+ // stays open and idle until Client is dropped
1055
+ let _ = rx2. recv ( ) ;
1053
1056
} ) ;
1054
1057
1055
1058
let client = Client :: builder ( )
0 commit comments