Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Martin Pugh
polkadot
Commits
075b3924
Verified
Commit
075b3924
authored
Aug 19, 2020
by
Andronik Ordian
Browse files
util: wait for both subsystem and test_future to finish
parent
eac833e4
Changes
1
Show whitespace changes
Inline
Side-by-side
node/subsystem-util/src/lib.rs
View file @
075b3924
...
...
@@ -1161,13 +1161,16 @@ mod tests {
futures
::
pin_mut!
(
subsystem
,
test_future
,
timeout
);
executor
::
block_on
(
async
move
{
futures
::
select!
{
_
=
test_future
.fuse
()
=>
(),
_
=
subsystem
.fuse
()
=>
(),
_
=
timeout
.fuse
()
=>
panic!
(
"test timed out instead of completing"
),
}
});
futures
::
executor
::
block_on
(
futures
::
future
::
select
(
// wait for both to finish
futures
::
future
::
join
(
subsystem
,
test_future
),
timeout
,
)
.then
(|
either
|
match
either
{
futures
::
future
::
Either
::
Right
(
_
)
=>
panic!
(
"test timed out instead of completing"
),
futures
::
future
::
Either
::
Left
(
_
)
=>
futures
::
future
::
ready
(()),
})
);
}
#[test]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment