-
Notifications
You must be signed in to change notification settings - Fork 823
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
fork-aware-tx-pool: add heavy load tests based on zombienet #7257
base: master
Are you sure you want to change the base?
Changes from 24 commits
0283ab9
67c2ee9
7afefe1
6d10819
0e084ab
daba086
f73874a
21fda5f
ef9b658
90ab08d
94b8891
136b95a
5556573
13cffe6
8ec35b9
0b81d99
5f82daf
e90b9d6
11fee80
fbc25ff
b912e05
bf02c0b
c30f602
f275ba3
8de7754
e59e4bf
2507d2c
032e631
0e5b5a9
3f27669
9a665b6
b1c9938
7cbf852
63a9943
2b06198
254ae67
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// This file is part of Substrate. | ||
|
||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 | ||
|
||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
// Testsuite of fatp integration tests. | ||
|
||
pub mod zombienet; | ||
|
||
use std::time::Duration; | ||
|
||
use tokio::join; | ||
use zombienet::NetworkSpawner; | ||
use zombienet_sdk::subxt::OnlineClient; | ||
|
||
#[tokio::test(flavor = "multi_thread")] | ||
async fn send_future_and_then_ready_from_single_account() { | ||
let _ = env_logger::try_init_from_env( | ||
env_logger::Env::default().filter_or(env_logger::DEFAULT_FILTER_ENV, "info"), | ||
); | ||
let net = NetworkSpawner::init_from_asset_hub_fatp_low_pool_limit_spec().await.unwrap(); | ||
pepoviola marked this conversation as resolved.
Show resolved
Hide resolved
|
||
let collator = net.get_node("charlie").unwrap(); | ||
iulianbarbu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
let _client: OnlineClient<zombienet_sdk::subxt::SubstrateConfig> = | ||
collator.wait_client_with_timeout(120u64).await.unwrap(); | ||
let ws = "ws://127.0.0.1:9933"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we get this URL from zn API? (if we update toml this can diverge). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc: @pepoviola There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, done here: 9a665b6 |
||
let mut nonce = 0; | ||
for _ in 0..3 { | ||
// Spawn future TXs. | ||
let future_start = nonce + 5; | ||
let handle1 = tokio::spawn(async move { | ||
cmd_lib::run_cmd!(RUST_LOG=info ttxt tx --chain=sub --ws=$ws from-single-account --account 0 --count 5 --from $future_start) | ||
}); | ||
tokio::time::sleep(Duration::from_secs(5)).await; | ||
iulianbarbu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
let handle2 = tokio::spawn(async move { | ||
cmd_lib::run_cmd!(RUST_LOG=info ttxt tx --chain=sub --ws=$ws from-single-account --account 0 --count 5 --from $nonce) | ||
}); | ||
nonce = future_start + 5; | ||
let (res1, res2) = join!(handle1, handle2); | ||
assert!(res1.is_ok()); | ||
assert!(res2.is_ok()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is
chrono
used?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can see, some of other crates seems to be not used, too.