denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
97.44k stars 5.37k forks source link

Deno panics when detailed coverage output is piped to quiet grep on macos terminal #24529

Open sambrtg opened 4 months ago

sambrtg commented 4 months ago

Steps to reproduce:

% deno test -A --coverage

...

% deno coverage --detailed | grep '100[.]'

cover file:///... ... 100.000% (1/1)
cover file:///... ... 100.000% (1/1)
cover file:///... ... 100.000% (28/28)

% deno coverage --detailed | grep -q '100[.]'

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: macos x86_64
Version: 1.45.0
Args: ["deno", "coverage", "--detailed"]

thread 'main' panicked at library/std/src/io/stdio.rs:1118:9:
failed printing to stdout: Broken pipe (os error 32)
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: std::io::stdio::_print
   3: <deno::tools::coverage::reporter::DetailedCoverageReporter as deno::tools::coverage::reporter::CoverageReporter>::report
   4: deno::tools::coverage::cover_files::{{closure}}
   5: deno::spawn_subcommand::{{closure}}
   6: <deno_unsync::task::MaskFutureAsSend<F> as core::future::future::Future>::poll
   7: tokio::runtime::task::raw::poll
   8: deno::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
yazan-abdalrahman commented 1 month ago

the same issue as #25258