Compare commits

...

2 Commits

Author SHA1 Message Date
1b2fd45c89
Add clippy to flake
All checks were successful
Build library & run tests / build (push) Successful in 18s
2024-06-21 12:48:58 +02:00
374e50ee6b
Add small random delay to async test for stress-testing 2024-06-21 12:48:52 +02:00
2 changed files with 5 additions and 1 deletions

View File

@ -19,7 +19,7 @@
doCheck = true;
};
devShell = with pkgs; mkShell {
nativeBuildInputs = with pkgs; [rustc cargo rustfmt pre-commit];
nativeBuildInputs = with pkgs; [rustc cargo rustfmt pre-commit clippy];
};
});
}

View File

@ -97,6 +97,10 @@ async fn heavy_async() {
for i in 0..100 {
let client = client.clone();
tasks.push(tokio::spawn(async move {
tokio::time::sleep(tokio::time::Duration::from_millis(
rand::random::<u64>() % 100,
))
.await;
let result = client.addition(i, i).await.unwrap();
assert_eq!(result, i + i);
}));