33// Base code from the httpserver in reqwest tests:
44// https://github.com/seanmonstar/reqwest/blob/master/tests/support/server.rs
55
6- use std:: { net:: SocketAddr , sync:: mpsc as std_mpsc, thread, time :: Duration } ;
6+ use std:: { net:: SocketAddr , sync:: mpsc as std_mpsc, thread} ;
77use tokio:: { runtime, sync:: oneshot} ;
88use warp:: { Filter , Reply } ;
99
1010/// A HTTP server for test
1111pub struct TestHttpServer {
1212 address : SocketAddr ,
13- panic_rx : std_mpsc:: Receiver < ( ) > ,
1413 shutdown_tx : Option < oneshot:: Sender < ( ) > > ,
1514}
1615
@@ -31,12 +30,6 @@ impl Drop for TestHttpServer {
3130 if let Some ( tx) = self . shutdown_tx . take ( ) {
3231 let _ = tx. send ( ( ) ) ;
3332 }
34-
35- if !:: std:: thread:: panicking ( ) {
36- self . panic_rx
37- . recv_timeout ( Duration :: from_secs ( 3 ) )
38- . expect ( "test server should not panic" ) ;
39- }
4033 }
4134}
4235
7164 } )
7265 } ) ;
7366
74- let ( panic_tx, panic_rx ) = std_mpsc:: channel ( ) ;
67+ let ( panic_tx, _ ) = std_mpsc:: channel ( ) ;
7568 let thread_name = format ! (
7669 "test({})-support-server" ,
7770 thread:: current( ) . name( ) . unwrap_or( "<unknown>" )
8679
8780 TestHttpServer {
8881 address,
89- panic_rx,
9082 shutdown_tx : Some ( shutdown_tx) ,
9183 }
9284 } )
0 commit comments