File tree Expand file tree Collapse file tree 2 files changed +32
-42
lines changed Expand file tree Collapse file tree 2 files changed +32
-42
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,7 @@ mod tests {
195
195
use std:: path:: Path ;
196
196
197
197
use super :: * ;
198
+ use crate :: { BitcoinRegtestController , BurnchainController } ;
198
199
mod utils {
199
200
use std:: net:: TcpListener ;
200
201
@@ -272,4 +273,35 @@ mod tests {
272
273
assert ! ( !bitcoind. is_running( ) , "should not be running after kill!" ) ;
273
274
assert ! ( data_path. exists( ) , "data path should exists after kill!" ) ;
274
275
}
276
+
277
+ #[ test]
278
+ #[ ignore]
279
+ fn test_bitcoind_restart_with_bootstrapped_chain_data ( ) {
280
+ if env:: var ( "BITCOIND_TEST" ) != Ok ( "1" . into ( ) ) {
281
+ return ;
282
+ }
283
+
284
+ let config = utils:: create_config ( ) ;
285
+
286
+ let mut btcd_controller = BitcoinCoreController :: from_stx_config ( & config) ;
287
+ btcd_controller
288
+ . start_bitcoind ( )
289
+ . expect ( "Failed starting bitcoind" ) ;
290
+
291
+ let btc_controller = BitcoinRegtestController :: new ( config, None ) ;
292
+ btc_controller. bootstrap_chain ( 201 ) ;
293
+ info ! ( "Chain bootstrapped..." ) ;
294
+
295
+ btcd_controller
296
+ . stop_bitcoind ( )
297
+ . expect ( "Failed to stop bitcoind" ) ;
298
+
299
+ btcd_controller
300
+ . start_bitcoind ( )
301
+ . expect ( "Failed to restart bitcoind" ) ;
302
+
303
+ btcd_controller
304
+ . stop_bitcoind ( )
305
+ . expect ( "Failed to re-stop bitcoind" ) ;
306
+ }
275
307
}
Original file line number Diff line number Diff line change @@ -10024,45 +10024,3 @@ fn listunspent_max_utxos() {
10024
10024
let utxos = res. expect ( "Failed to get utxos" ) ;
10025
10025
assert_eq ! ( utxos. num_utxos( ) , 10 ) ;
10026
10026
}
10027
-
10028
- #[ test]
10029
- #[ ignore]
10030
- /// Test out stopping bitcoind and restarting it
10031
- fn start_stop_bitcoind ( ) {
10032
- if env:: var ( "BITCOIND_TEST" ) != Ok ( "1" . into ( ) ) {
10033
- return ;
10034
- }
10035
-
10036
- let ( mut conf, _miner_account) = neon_integration_test_conf ( ) ;
10037
- let prom_port = gen_random_port ( ) ;
10038
- let localhost = "127.0.0.1" ;
10039
- let prom_bind = format ! ( "{localhost}:{prom_port}" ) ;
10040
- conf. node . prometheus_bind = Some ( prom_bind) ;
10041
-
10042
- conf. burnchain . max_rbf = 1000000 ;
10043
-
10044
- let mut btcd_controller = BitcoinCoreController :: from_stx_config ( & conf) ;
10045
- btcd_controller
10046
- . start_bitcoind ( )
10047
- . expect ( "Failed starting bitcoind" ) ;
10048
-
10049
- let btc_regtest_controller = BitcoinRegtestController :: new ( conf, None ) ;
10050
-
10051
- btc_regtest_controller. bootstrap_chain ( 201 ) ;
10052
-
10053
- eprintln ! ( "Chain bootstrapped..." ) ;
10054
-
10055
- btcd_controller
10056
- . stop_bitcoind ( )
10057
- . expect ( "Failed to stop bitcoind" ) ;
10058
-
10059
- thread:: sleep ( Duration :: from_secs ( 5 ) ) ;
10060
-
10061
- btcd_controller
10062
- . start_bitcoind ( )
10063
- . expect ( "Failed to start bitcoind" ) ;
10064
-
10065
- btcd_controller
10066
- . stop_bitcoind ( )
10067
- . expect ( "Failed to stop bitcoind" ) ;
10068
- }
You can’t perform that action at this time.
0 commit comments