Skip to content

Change two std process tests to not output to std{out,err}, and fix test suite stat reset in bootstrap CI test rendering #136630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions library/std/src/process/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,13 @@ fn test_creation_flags() {
const EXIT_PROCESS_DEBUG_EVENT: u32 = 5;
const DBG_EXCEPTION_NOT_HANDLED: u32 = 0x80010001;

let mut child =
Command::new("cmd").creation_flags(DEBUG_PROCESS).stdin(Stdio::piped()).spawn().unwrap();
let mut child = Command::new("cmd")
.creation_flags(DEBUG_PROCESS)
.stdin(Stdio::piped())
.stdout(Stdio::null())
.stderr(Stdio::null())
.spawn()
.unwrap();
child.stdin.take().unwrap().write_all(b"exit\r\n").unwrap();
let mut events = 0;
let mut event = DEBUG_EVENT { event_code: 0, process_id: 0, thread_id: 0, _junk: [0; 164] };
Expand Down Expand Up @@ -486,9 +491,13 @@ fn test_proc_thread_attributes() {
}
}

let parent = ProcessDropGuard(Command::new("cmd").spawn().unwrap());
let mut parent = Command::new("cmd");
parent.stdout(Stdio::null()).stderr(Stdio::null());

let parent = ProcessDropGuard(parent.spawn().unwrap());

let mut child_cmd = Command::new("cmd");
child_cmd.stdout(Stdio::null()).stderr(Stdio::null());

let parent_process_handle = parent.0.as_raw_handle();

Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/src/utils/render_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ impl<'a> Renderer<'a> {
match message {
Message::Suite(SuiteMessage::Started { test_count }) => {
println!("\nrunning {test_count} tests");
self.benches = vec![];
self.failures = vec![];
self.ignored_tests = 0;
Comment on lines +313 to +315
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I over looked this in #135355 😅

self.executed_tests = 0;
self.terse_tests_in_line = 0;
self.tests_count = Some(test_count);
Expand Down
Loading