Skip to content

Commit

Permalink
Merge pull request #13733 from MinaProtocol/feature/timeouts-for-boot…
Browse files Browse the repository at this point in the history
…strap

[berkeley] Make medium bootstrap sections hard fail
  • Loading branch information
mrmr1993 authored Jul 27, 2023
2 parents 37d1972 + ffed8b5 commit 15133c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
17 changes: 9 additions & 8 deletions src/app/test_executive/medium_bootstrap.ml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ module Make (Inputs : Intf.Test.Inputs_intf) = struct
let logger = Logger.create () in
let all_nodes = Network.all_nodes network in
let%bind () =
wait_for t
(Wait_condition.nodes_to_initialize (Core.String.Map.data all_nodes))
section_hard "Wait for nodes to initialize"
(wait_for t
(Wait_condition.nodes_to_initialize (Core.String.Map.data all_nodes)) )
in
let node_a =
Core.String.Map.find_exn (Network.block_producers network) "node-a"
Expand All @@ -62,11 +63,11 @@ module Make (Inputs : Intf.Test.Inputs_intf) = struct
Core.String.Map.find_exn (Network.block_producers network) "node-c"
in
let%bind () =
section "blocks are produced"
section_hard "blocks are produced"
(wait_for t (Wait_condition.blocks_to_be_produced 1))
in
let%bind () =
section "restart node after 2k+1, ie 5, blocks"
section_hard "restart node after 2k+1, ie 5, blocks"
(let%bind () = Node.stop node_c in
[%log info] "%s stopped, will now wait for blocks to be produced"
(Node.id node_c) ;
Expand All @@ -80,19 +81,19 @@ module Make (Inputs : Intf.Test.Inputs_intf) = struct
(Wait_condition.nodes_to_synchronize [ node_a; node_b; node_c ]) )
in
let%bind () =
section "network is fully connected after one node was restarted"
section_hard "network is fully connected after one node was restarted"
(let%bind () = Malleable_error.lift (after (Time.Span.of_sec 240.0)) in
let%bind final_connectivity_data =
fetch_connectivity_data ~logger (Core.String.Map.data all_nodes)
in
assert_peers_completely_connected final_connectivity_data )
in
let%bind () =
section "blocks are produced"
section_hard "blocks are produced"
(wait_for t (Wait_condition.blocks_to_be_produced 1))
in
let%bind () =
section "restart node with the same state after 1 block"
section_hard "restart node with the same state after 1 block"
(let%bind () = Node.stop node_c in
[%log info] "%s stopped, will now wait for blocks to be produced"
(Node.id node_c) ;
Expand All @@ -112,7 +113,7 @@ module Make (Inputs : Intf.Test.Inputs_intf) = struct
(Wait_condition.nodes_to_synchronize [ node_a; node_b; node_c ]) )
in

section "network is fully connected after one node was restarted"
section_hard "network is fully connected after one node was restarted"
(let%bind () = Malleable_error.lift (after (Time.Span.of_sec 240.0)) in
let%bind final_connectivity_data =
fetch_connectivity_data ~logger (Core.String.Map.data all_nodes)
Expand Down
5 changes: 3 additions & 2 deletions src/lib/integration_test_lib/wait_condition.ml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ struct
then Predicate_passed
else Predicate_continuation ()
in
let soft_timeout_in_slots = 8 * 3 in
let soft_timeout_in_slots = 4 in
let hard_timeout_in_slots = 6 in
let formatted_nodes =
nodes
|> List.map ~f:(fun node -> "\"" ^ Node.id node ^ "\"")
Expand All @@ -216,7 +217,7 @@ struct
; description = sprintf "%s to synchronize" formatted_nodes
; predicate = Network_state_predicate (check (), check)
; soft_timeout = Slots soft_timeout_in_slots
; hard_timeout = Slots (soft_timeout_in_slots * 2)
; hard_timeout = Slots hard_timeout_in_slots
}

let signed_command_to_be_included_in_frontier ~txn_hash
Expand Down

0 comments on commit 15133c0

Please sign in to comment.