mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-24 09:57:08 -06:00
test: use tokio::time::sleep in async test poll loop (SonarCloud rust:S7488)
The multi-thread #[tokio::test] polled with a blocking std::thread::sleep, stalling a runtime worker. Use tokio::time::sleep(..).await instead.
This commit is contained in:
@@ -1197,7 +1197,7 @@ mod tests {
|
||||
break;
|
||||
}
|
||||
assert!(t.elapsed().as_secs() < 60, "doc_inspect never saw the finished job: {inspected}");
|
||||
std::thread::sleep(std::time::Duration::from_millis(5));
|
||||
tokio::time::sleep(std::time::Duration::from_millis(5)).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user