From c9ad9ccb0691b8713ecfb840da897580c2f49f2b Mon Sep 17 00:00:00 2001 From: "zhoujun.ma" Date: Wed, 19 Jun 2024 22:15:08 -0700 Subject: [PATCH] fix keyless test flakiness --- testsuite/smoke-test/src/keyless.rs | 32 +++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/testsuite/smoke-test/src/keyless.rs b/testsuite/smoke-test/src/keyless.rs index c716ccf928b53..c7735a39e9ad3 100644 --- a/testsuite/smoke-test/src/keyless.rs +++ b/testsuite/smoke-test/src/keyless.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::smoke_test_environment::SwarmBuilder; -use aptos::test::CliTestFramework; +use aptos::{common::types::GasOptions, test::CliTestFramework}; use aptos_cached_packages::aptos_stdlib; use aptos_crypto::{ ed25519::{Ed25519PrivateKey, Ed25519PublicKey}, @@ -495,7 +495,15 @@ fun main(core_resources: &signer) {{ "#, KEYLESS_ACCOUNT_MODULE_NAME, KEYLESS_ACCOUNT_MODULE_NAME ); - let txn_summary = cli.run_script(root_idx, &script).await.unwrap(); + let gas_options = GasOptions { + gas_unit_price: Some(100), + max_gas: Some(2000000), + expiration_secs: 60, + }; + let txn_summary = cli + .run_script_with_gas_options(root_idx, &script, Some(gas_options)) + .await + .unwrap(); debug!("txn_summary={:?}", txn_summary); // Increment sequence number as we ran a governance proposal @@ -596,7 +604,15 @@ fun main(core_resources: &signer) {{ hex::encode(training_wheels_pk.to_bytes()) ); - let txn_summary = cli.run_script(root_idx, &script).await.unwrap(); + let gas_options = GasOptions { + gas_unit_price: Some(100), + max_gas: Some(2000000), + expiration_secs: 60, + }; + let txn_summary = cli + .run_script_with_gas_options(root_idx, &script, Some(gas_options)) + .await + .unwrap(); debug!("txn_summary={:?}", txn_summary); info!("Use resource API to check the patch result."); @@ -680,7 +696,15 @@ script {{ ) .await; - let txn_summary = cli.run_script(root_idx, &script).await.unwrap(); + let gas_options = GasOptions { + gas_unit_price: Some(100), + max_gas: Some(2000000), + expiration_secs: 60, + }; + let txn_summary = cli + .run_script_with_gas_options(root_idx, &script, Some(gas_options)) + .await + .unwrap(); debug!("txn_summary={:?}", txn_summary); // Increment sequence number as we ran a governance proposal