From d4c726f5eb17f26774641370f8e85b02c3283c4e Mon Sep 17 00:00:00 2001 From: Alain Mebsout Date: Thu, 19 Oct 2023 10:50:17 +0200 Subject: [PATCH 1/3] Rollup node: detect other cases of connection errors --- src/lib_crawler/layer_1.ml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib_crawler/layer_1.ml b/src/lib_crawler/layer_1.ml index c508589f1dac..b661402f1f48 100644 --- a/src/lib_crawler/layer_1.ml +++ b/src/lib_crawler/layer_1.ml @@ -135,6 +135,8 @@ let shutdown state = state.running <- false ; Lwt.return_unit +let regexp_ocaml_exception_connection_error = Re.Str.regexp ".*in connect:.*" + let is_connection_error trace = TzTrace.fold (fun yes error -> @@ -143,6 +145,10 @@ let is_connection_error trace = match error with | RPC_client_errors.(Request_failed {error = Connection_failed _; _}) -> true + | RPC_client_errors.(Request_failed {error = OCaml_exception s; _}) -> + (* This error can surface if the external RPC servers of the L1 node are + shutdown but the request is still in the RPC worker. *) + Re.Str.string_match regexp_ocaml_exception_connection_error s 0 | _ -> false) false trace -- GitLab From a8888768151868df623003776ec3288c5135137c Mon Sep 17 00:00:00 2001 From: Alain Mebsout Date: Thu, 19 Oct 2023 11:02:52 +0200 Subject: [PATCH 2/3] Tests: retry command 10 times in migration tests --- tezt/tests/sc_rollup.ml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tezt/tests/sc_rollup.ml b/tezt/tests/sc_rollup.ml index dc4f45532e7a..628254918fd3 100644 --- a/tezt/tests/sc_rollup.ml +++ b/tezt/tests/sc_rollup.ml @@ -3590,14 +3590,21 @@ let test_refutation_scenario_aux ~(mode : Sc_rollup_node.mode) ~kind loser_sc_rollup_nodes else unit in - (* Calls that can fail because the node is down due to the ongoing migration - need to be retried. *) + (* Calls that can fail because the node is down (or shutting down) due to the + ongoing migration need to be retried (10 times). *) let retry f = - let f _ = - let* () = Node.wait_for_ready node in - f () + let rec retry count = + let f _ = + let* () = Node.wait_for_ready node in + f () + in + Lwt.catch f (fun e -> + if count = 0 then raise e + else + let* () = Lwt_unix.sleep 0.5 in + retry (count - 1)) in - Lwt.catch f f + retry 10 in let rec consume_inputs = function | [] -> unit -- GitLab From bfe3d9313522c040fe2dbc655b060f4023628761 Mon Sep 17 00:00:00 2001 From: Alain Mebsout Date: Thu, 19 Oct 2023 11:54:52 +0200 Subject: [PATCH 3/3] Tests: mark migration refutation tests as non flaky any more --- tezt/tests/sc_rollup.ml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tezt/tests/sc_rollup.ml b/tezt/tests/sc_rollup.ml index 628254918fd3..ee5e926681b9 100644 --- a/tezt/tests/sc_rollup.ml +++ b/tezt/tests/sc_rollup.ml @@ -3746,13 +3746,11 @@ let test_refutation_scenario ?commitment_period ?challenge_window ~variant ~mode } (test_refutation_scenario_aux ~mode ~kind scenario) -let test_refutation_migration_scenario ?(flaky = false) ?commitment_period - ?challenge_window ~variant ~mode ~kind scenario ~migrate_from ~migrate_to - ~migration_on_event = +let test_refutation_migration_scenario ?commitment_period ?challenge_window + ~variant ~mode ~kind scenario ~migrate_from ~migrate_to ~migration_on_event + = let tags = - (if flaky then [Tag.flaky] else []) - @ ["refutation"] - @ if mode = Sc_rollup_node.Accuser then ["accuser"] else [] + ["refutation"] @ if mode = Sc_rollup_node.Accuser then ["accuser"] else [] in let variant = variant ^ if mode = Accuser then "+accuser" else "" in @@ -4027,7 +4025,6 @@ let test_refutation_migration ~migrate_from ~migrate_to = (fun (migration_variant, migration_on_event) -> let variant = String.concat "_" [variant; migration_variant] in test_refutation_migration_scenario - ~flaky:true ~kind:"wasm_2_0_0" (* The tests for refutations over migrations are only ran for wasm as the arith PVMs do not have the same semantic in all -- GitLab