3
3
// Base code from the httpserver in reqwest tests:
4
4
// https://github.com/seanmonstar/reqwest/blob/master/tests/support/server.rs
5
5
6
- use std:: { net:: SocketAddr , sync:: mpsc as std_mpsc, thread, time :: Duration } ;
6
+ use std:: { net:: SocketAddr , sync:: mpsc as std_mpsc, thread} ;
7
7
use tokio:: { runtime, sync:: oneshot} ;
8
8
use warp:: { Filter , Reply } ;
9
9
10
10
/// A HTTP server for test
11
11
pub struct TestHttpServer {
12
12
address : SocketAddr ,
13
- panic_rx : std_mpsc:: Receiver < ( ) > ,
14
13
shutdown_tx : Option < oneshot:: Sender < ( ) > > ,
15
14
}
16
15
@@ -31,12 +30,6 @@ impl Drop for TestHttpServer {
31
30
if let Some ( tx) = self . shutdown_tx . take ( ) {
32
31
let _ = tx. send ( ( ) ) ;
33
32
}
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
- }
40
33
}
41
34
}
42
35
71
64
} )
72
65
} ) ;
73
66
74
- let ( panic_tx, panic_rx ) = std_mpsc:: channel ( ) ;
67
+ let ( panic_tx, _ ) = std_mpsc:: channel ( ) ;
75
68
let thread_name = format ! (
76
69
"test({})-support-server" ,
77
70
thread:: current( ) . name( ) . unwrap_or( "<unknown>" )
86
79
87
80
TestHttpServer {
88
81
address,
89
- panic_rx,
90
82
shutdown_tx : Some ( shutdown_tx) ,
91
83
}
92
84
} )
0 commit comments