From 6a00a98b404f613edbcee0b4112c073c421bead1 Mon Sep 17 00:00:00 2001 From: rvanasa Date: Mon, 22 Jan 2024 14:12:48 -0700 Subject: [PATCH 1/2] Add ignored service/method combinations in Motoko E2E testing --- e2e/motoko/Main.mo | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/e2e/motoko/Main.mo b/e2e/motoko/Main.mo index 18dcf361..2eac44b6 100644 --- a/e2e/motoko/Main.mo +++ b/e2e/motoko/Main.mo @@ -12,6 +12,11 @@ shared ({ caller = installer }) actor class Main() { public shared ({ caller }) func test() : async () { assert caller == installer; + let ignoredTests : [(EvmRpcCanister.RpcService, Text)] = [ + // (`RPC service`, `method`) + (#EthMainnet(#BlockPi), "eth_sendRawTransaction"), // Occasional errors + ]; + let canisterDetails = [ // (`canister module`, `debug name`, `nodes in subnet`, `expected cycles for JSON-RPC call`) (EvmRpcCanister, "default", 13, 65_923_200), @@ -100,6 +105,12 @@ shared ({ caller = installer }) actor class Main() { switch result { case (#Ok(_)) {}; case (#Err(err)) { + for ((ignoredService, ignoredMethod) in ignoredTests.vals()) { + if (service == ignoredService and method == ignoredMethod) { + Debug.print("Ignoring error from " # debug_show ignoredService # " " # ignoredMethod); + return; + }; + }; Debug.trap("received error in inconsistent results for " # debug_show service # " " # method # ": " # debug_show err); }; }; From c55ac67197e23cad4b94b664a2f242c2463ad53f Mon Sep 17 00:00:00 2001 From: rvanasa Date: Mon, 22 Jan 2024 14:14:29 -0700 Subject: [PATCH 2/2] Add comment for clarity --- e2e/motoko/Main.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/motoko/Main.mo b/e2e/motoko/Main.mo index 2eac44b6..87faa999 100644 --- a/e2e/motoko/Main.mo +++ b/e2e/motoko/Main.mo @@ -14,7 +14,7 @@ shared ({ caller = installer }) actor class Main() { let ignoredTests : [(EvmRpcCanister.RpcService, Text)] = [ // (`RPC service`, `method`) - (#EthMainnet(#BlockPi), "eth_sendRawTransaction"), // Occasional errors + (#EthMainnet(#BlockPi), "eth_sendRawTransaction"), // "Private transaction replacement (same nonce) with gas price change lower than 10% is not allowed within 30 sec from the previous transaction." ]; let canisterDetails = [