diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-05-10 16:24:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-10 16:24:37 -0400 |
commit | abf72c5b375205b1d7d3565c7660ef70e464c45d (patch) | |
tree | 0436c2c218f0b62833eb847a049cbb943c6797a1 | |
parent | 11c13fb9819a479a5a69278fff3703cf893d3df1 (diff) |
chore: fix flaky steps_output_within - part 2 (#14562)
-rw-r--r-- | cli/tools/test.rs | 6 | ||||
-rw-r--r-- | test_util/src/lib.rs | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/cli/tools/test.rs b/cli/tools/test.rs index 6ed443806..5395de6af 100644 --- a/cli/tools/test.rs +++ b/cli/tools/test.rs @@ -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(); diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs index 59a777d40..0eea21b04 100644 --- a/test_util/src/lib.rs +++ b/test_util/src/lib.rs @@ -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 { |