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:
parent
11c13fb981
commit
abf72c5b37
2 changed files with 10 additions and 3 deletions
|
@ -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();
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue