async fn wait_for_tasks(exec: &DedicatedExecutor, num: usize) {
        tokio::time::timeout(Duration::from_secs(1), async {
            loop {
                if dbg!(exec.tasks()) == num {
                    return;
                }
                tokio::time::sleep(Duration::from_millis(1)).await;
            }
        })
        .await
        .expect("Did not find expected num tasks within a second")
    }
// waits for up to 1 sec for the correct number of tasks
waits for up to 1 sec for the correct number of tasks
waits for up to 1 sec for the correct number of tasks
async fn wait_for_tasks(exec: &DedicatedExecutor, num: usize) {
        tokio::time::timeout(Duration::from_secs(1), async {
            loop {
                if dbg!(exec.tasks()) == num {
                    return;
                }
                tokio::time::sleep(Duration::from_millis(1)).await;
            }
        })
        .await
        .expect("Did not find expected num tasks within a second")
    }
async fn wait_for_tasks ( exec : & DedicatedExecutor , num : usize ) { tokio :: time :: timeout ( Duration :: from_secs ( 1 ) , async { loop { if dbg ! ( exec tasks ( ) ) == num { return ; } tokio :: time :: sleep ( Duration :: from_millis ( 1 ) ) . await ; } } ) . await . expect ( " " ) }
waits for up to 1 sec for the correct number of tasks
waits for up to 1 sec for the correct number of tasks
exec
&DedicatedExecutor
num
usize
exec
&DedicatedExecutor
num
usize