And one more fix to flaky tests (#5467)

* imporoved intervallier version

* remove extra event

* use version 0.3.1

* fix warning
This commit is contained in:
Nikolay Volf
2020-03-31 03:15:31 -07:00
committed by GitHub
parent 439887a773
commit b4d83a4b54
4 changed files with 11 additions and 22 deletions
+2 -2
View File
@@ -2348,9 +2348,9 @@ checksum = "141340095b15ed7491bd3d4ced9d20cebfb826174b6bb03386381f62b01e3d77"
[[package]]
name = "intervalier"
version = "0.3.0"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "750dc2c10615a0aa0d38a5adf9d4e62651c178109f40253cb6235b3f638af6a9"
checksum = "14200459dc2319eb13708aed1c1efb8307e0e0e801e7282476939492e1492631"
dependencies = [
"futures 0.3.4",
"futures-timer 2.0.2",
@@ -64,7 +64,6 @@ use libp2p::swarm::{
NegotiatedSubstream,
};
use log::{debug, error};
use sp_runtime::ConsensusEngineId;
use std::{borrow::Cow, error, io, str, task::{Context, Poll}};
/// Implements the `IntoProtocolsHandler` trait of libp2p.
+1 -1
View File
@@ -23,7 +23,7 @@ sc-transaction-graph = { version = "2.0.0-alpha.5", path = "./graph" }
sp-transaction-pool = { version = "2.0.0-alpha.5", path = "../../primitives/transaction-pool" }
sc-client-api = { version = "2.0.0-alpha.5", path = "../api" }
sp-blockchain = { version = "2.0.0-alpha.5", path = "../../primitives/blockchain" }
intervalier = "0.3"
intervalier = "0.3.1"
parity-util-mem = { version = "0.6.0", default-features = false, features = ["primitive-types"] }
[dev-dependencies]
@@ -219,10 +219,9 @@ fn should_revalidate_during_maintenance() {
pool.api.push_block(1, vec![xt1.clone()]);
notifier.clear();
block_on(pool.maintain(block_event(1)));
assert_eq!(pool.status().ready, 1);
block_on(notifier.next());
block_on(notifier.next_blocking());
// test that pool revalidated transaction that left ready and not included in the block
assert_eq!(pool.api.validation_requests().len(), 3);
@@ -263,14 +262,10 @@ fn should_not_retain_invalid_hashes_from_retracted() {
let event = block_event_with_retracted(1, vec![retracted_hash]);
notifier.clear();
block_on(pool.maintain(event));
// maintenance is in background
block_on(notifier.next());
let event = block_event_with_retracted(1, vec![retracted_hash]);
block_on(pool.maintain(event));
block_on(notifier.next_blocking());
assert_eq!(pool.status().ready, 0);
}
@@ -285,9 +280,8 @@ fn should_revalidate_transaction_multiple_times() {
pool.api.push_block(1, vec![xt.clone()]);
notifier.clear();
block_on(pool.maintain(block_event(1)));
block_on(notifier.next());
block_on(notifier.next_blocking());
block_on(pool.submit_one(&BlockId::number(0), SOURCE, xt.clone())).expect("1. Imported");
assert_eq!(pool.status().ready, 1);
@@ -295,9 +289,8 @@ fn should_revalidate_transaction_multiple_times() {
pool.api.push_block(2, vec![]);
pool.api.add_invalid(&xt);
notifier.clear();
block_on(pool.maintain(block_event(2)));
block_on(notifier.next());
block_on(notifier.next_blocking());
assert_eq!(pool.status().ready, 0);
}
@@ -315,17 +308,15 @@ fn should_revalidate_across_many_blocks() {
assert_eq!(pool.status().ready, 2);
pool.api.push_block(1, vec![]);
notifier.clear();
block_on(pool.maintain(block_event(1)));
block_on(notifier.next());
block_on(notifier.next_blocking());
block_on(pool.submit_one(&BlockId::number(2), SOURCE, xt3.clone())).expect("1. Imported");
assert_eq!(pool.status().ready, 3);
pool.api.push_block(2, vec![xt1.clone()]);
notifier.clear();
block_on(pool.maintain(block_event(2)));
block_on(notifier.next());
block_on(notifier.next_blocking());
assert_eq!(pool.status().ready, 2);
// xt1 and xt2 validated twice, then xt3 once, then xt2 and xt3 again
@@ -369,9 +360,8 @@ fn should_push_watchers_during_maintaince() {
pool.api.add_invalid(&tx4);
// clear timer events if any
notifier.clear();
block_on(pool.maintain(block_event(0)));
block_on(notifier.next());
block_on(notifier.next_blocking());
// then
// hash3 is now invalid