Tests now compile but take too long on github actions

This commit is contained in:
Igor Katson 2024-03-05 01:53:41 -08:00
parent b8611fdaf4
commit 25cd3c75cc
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
2 changed files with 3 additions and 2 deletions

View file

@ -76,3 +76,4 @@ futures = {version = "0.3"}
tracing-subscriber = "0.3"
tokio-test = "0.4"
tempfile = "3"
rand = {version = "0.8", features = ["small_rng"]}

View file

@ -1,7 +1,7 @@
use std::{io::Write, path::Path};
use librqbit_core::Id20;
use rand::RngCore;
use rand::{RngCore, SeedableRng};
use tempfile::TempDir;
pub fn create_new_file_with_random_content(path: &Path, mut size: usize) {
@ -14,7 +14,7 @@ pub fn create_new_file_with_random_content(path: &Path, mut size: usize) {
eprintln!("creating temp file {:?}", path);
const BUF_SIZE: usize = 8192 * 16;
let mut rng = rand::rngs::OsRng;
let mut rng = rand::rngs::SmallRng::from_entropy();
let mut write_buf = [0; BUF_SIZE];
while size > 0 {
rng.fill_bytes(&mut write_buf[..]);