0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

chore: fix flaky steps_output_within - part 2 (#14562)

This commit is contained in:
David Sherret 2022-05-10 16:24:37 -04:00 committed by GitHub
parent 11c13fb981
commit abf72c5b37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -1623,9 +1623,9 @@ impl TestOutputPipe {
// that it's done clearing out its pipe before returning.
let (sender, receiver) = std::sync::mpsc::channel();
self.state.lock().replace(sender);
// Bit of a hack in order to send a zero width space in order
// to wake the thread up. It seems that sending zero bytes
// does not work here on windows.
// Bit of a hack to send a zero width space in order to wake
// the thread up. It seems that sending zero bytes here does
// not work on windows.
self.writer.write_all(ZERO_WIDTH_SPACE.as_bytes()).unwrap();
self.writer.flush().unwrap();
receiver.recv().unwrap();

View file

@ -1819,6 +1819,13 @@ impl<'a> CheckOutputIntegrationTest<'a> {
actual = strip_ansi_codes(&actual).to_string();
// deno test's output capturing flushes with a zero-width space in order to
// synchronize the output pipes. Occassionally this zero width space
// might end up in the output so strip it from the output comparison here.
if args.get(0) == Some(&"test") {
actual = actual.replace('\u{200B}', "");
}
let expected = if let Some(s) = self.output_str {
s.to_owned()
} else {