Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix keyless test flakiness #13764

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions testsuite/smoke-test/src/keyless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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 {
Copy link
Contributor

@geekflyer geekflyer Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make this more DRY instead of copy pasting the same code into 3 places?

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
Expand Down Expand Up @@ -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.");
Expand Down Expand Up @@ -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
Expand Down
Loading