From 3a784944c827c1cfe0b6cf6a2670194b1ac1669a Mon Sep 17 00:00:00 2001 From: Aaron Ang <67321817+aaron-ang@users.noreply.github.com> Date: Thu, 8 Jan 2026 17:20:14 -0800 Subject: [PATCH] fix: reduce factor parallel test runtime --- tests/by-util/test_factor.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/by-util/test_factor.rs b/tests/by-util/test_factor.rs index 81888597034..0a9e6c3e5ea 100644 --- a/tests/by-util/test_factor.rs +++ b/tests/by-util/test_factor.rs @@ -60,15 +60,15 @@ fn test_repeated_exponents() { fn test_parallel() { use hex_literal::hex; use sha1::{Digest, Sha1}; - use std::{fs::OpenOptions, time::Duration}; + use std::fs::OpenOptions; use tempfile::TempDir; use uutests::{ util::{AtPath, TestScenario}, util_name, }; // factor should only flush the buffer at line breaks - let n_integers = 100_000; - let mut input_string = String::new(); + let n_integers = 50_000; + let mut input_string = String::with_capacity(n_integers * 6); for i in 0..=n_integers { let _ = write!(input_string, "{i} "); } @@ -81,10 +81,9 @@ fn test_parallel() { .open(tmp_dir.plus("output")) .unwrap(); - for child in (0..10) + for child in (0..8) .map(|_| { new_ucmd!() - .timeout(Duration::from_secs(240)) .set_stdout(output.try_clone().unwrap()) .pipe_in(input_string.clone()) .run_no_wait() @@ -103,7 +102,7 @@ fn test_parallel() { let hash_check = hasher.finalize(); assert_eq!( hash_check[..], - hex!("cc743607c0ff300ff575d92f4ff0c87d5660c393") + hex!("73f104b140449feac7ccf27b4c13ef6b9a4c5ee4") ); }