mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-25 10:41:08 +00:00
grandpa: speed up tests (#8439)
* grandpa: tests: add peers with authority role * grandpa: tests: manually wake-up poll_fn future
This commit is contained in:
@@ -987,7 +987,7 @@ mod tests {
|
||||
threads_pool.spawn_ok(until_imported.into_future().map(|_| ()));
|
||||
|
||||
// assert that we will make sync requests
|
||||
let assert = futures::future::poll_fn(|_| {
|
||||
let assert = futures::future::poll_fn(|ctx| {
|
||||
let block_sync_requests = block_sync_requester.requests.lock();
|
||||
|
||||
// we request blocks targeted by the precommits that aren't imported
|
||||
@@ -997,6 +997,11 @@ mod tests {
|
||||
return Poll::Ready(());
|
||||
}
|
||||
|
||||
// NOTE: nothing in this function is future-aware (i.e nothing gets registered to wake
|
||||
// up this future), we manually wake up this task to avoid having to wait until the
|
||||
// timeout below triggers.
|
||||
ctx.waker().wake_by_ref();
|
||||
|
||||
Poll::Pending
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user