|
|
|
@ -76,6 +76,7 @@ impl SecRun {
@@ -76,6 +76,7 @@ impl SecRun {
|
|
|
|
|
self.start_time.map(|t| t.elapsed()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[allow(dead_code)] |
|
|
|
|
fn is_done(&self) -> Option<bool> { |
|
|
|
|
self.elapsed().map(|elapsed| elapsed >= self.duration) |
|
|
|
|
} |
|
|
|
@ -210,6 +211,7 @@ pub struct SectionRunner {
@@ -210,6 +211,7 @@ pub struct SectionRunner {
|
|
|
|
|
msg_send: mpsc::Sender<RunnerMsg>, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[allow(dead_code)] |
|
|
|
|
impl SectionRunner { |
|
|
|
|
pub fn new(interface: Arc<dyn SectionInterface + Sync>) -> Self { |
|
|
|
|
let (msg_send, msg_recv) = mpsc::channel(8); |
|
|
|
@ -326,7 +328,7 @@ mod test {
@@ -326,7 +328,7 @@ mod test {
|
|
|
|
|
|
|
|
|
|
async fn advance(dur: Duration) { |
|
|
|
|
// HACK: advance should really be enough, but we need another yield_now
|
|
|
|
|
tokio::time::advance(Duration::from_secs(10)).await; |
|
|
|
|
tokio::time::advance(dur).await; |
|
|
|
|
tokio::task::yield_now().await; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -393,7 +395,7 @@ mod test {
@@ -393,7 +395,7 @@ mod test {
|
|
|
|
|
.await |
|
|
|
|
.unwrap(); |
|
|
|
|
|
|
|
|
|
let run2 = runner |
|
|
|
|
let _run2 = runner |
|
|
|
|
.queue_run(sections[0].clone(), Duration::from_secs(10)) |
|
|
|
|
.await |
|
|
|
|
.unwrap(); |
|
|
|
|