<p dir="auto">I noticed the Rust tries to setup the cache twice when spinning up the compiler isolate:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="DEBUG RS - mkdir -p /Users/kkelly/.deno/gen
DEBUG RS - set dir perm to 493
DEBUG RS - mkdir -p /Users/kkelly/.deno/deps
DEBUG RS - set dir perm to 493
DEBUG RS - mkdir -p /Users/kkelly/.deno/deps/http
DEBUG RS - set dir perm to 493
DEBUG RS - mkdir -p /Users/kkelly/.deno/deps/https
DEBUG RS - set dir perm to 493
DEBUG RS - root /Users/kkelly/.deno
DEBUG RS - gen /Users/kkelly/.deno/gen
DEBUG RS - deps /Users/kkelly/.deno/deps
DEBUG RS - deps_http /Users/kkelly/.deno/deps/http
DEBUG RS - deps_https /Users/kkelly/.deno/deps/https
DEBUG RS - msg_from_js Start sync true
DEBUG JS - cwd /Users/kkelly/github/deno
DEBUG JS - args [ &quot;tests/005_more_imports.ts&quot; ]
...
DEBUG RS - &gt;&gt;&gt;&gt;&gt; compile_sync START
DEBUG RS - mkdir -p /Users/kkelly/.deno/gen
DEBUG RS - set dir perm to 493
DEBUG RS - mkdir -p /Users/kkelly/.deno/deps
DEBUG RS - set dir perm to 493
DEBUG RS - mkdir -p /Users/kkelly/.deno/deps/http
DEBUG RS - set dir perm to 493
DEBUG RS - mkdir -p /Users/kkelly/.deno/deps/https
DEBUG RS - set dir perm to 493"><pre class="notranslate"><code class="notranslate">DEBUG RS - mkdir -p /Users/kkelly/.deno/gen
DEBUG RS - set dir perm to 493
DEBUG RS - mkdir -p /Users/kkelly/.deno/deps
DEBUG RS - set dir perm to 493
DEBUG RS - mkdir -p /Users/kkelly/.deno/deps/http
DEBUG RS - set dir perm to 493
DEBUG RS - mkdir -p /Users/kkelly/.deno/deps/https
DEBUG RS - set dir perm to 493
DEBUG RS - root /Users/kkelly/.deno
DEBUG RS - gen /Users/kkelly/.deno/gen
DEBUG RS - deps /Users/kkelly/.deno/deps
DEBUG RS - deps_http /Users/kkelly/.deno/deps/http
DEBUG RS - deps_https /Users/kkelly/.deno/deps/https
DEBUG RS - msg_from_js Start sync true
DEBUG JS - cwd /Users/kkelly/github/deno
DEBUG JS - args [ "tests/005_more_imports.ts" ]
...
DEBUG RS - &gt;&gt;&gt;&gt;&gt; compile_sync START
DEBUG RS - mkdir -p /Users/kkelly/.deno/gen
DEBUG RS - set dir perm to 493
DEBUG RS - mkdir -p /Users/kkelly/.deno/deps
DEBUG RS - set dir perm to 493
DEBUG RS - mkdir -p /Users/kkelly/.deno/deps/http
DEBUG RS - set dir perm to 493
DEBUG RS - mkdir -p /Users/kkelly/.deno/deps/https
DEBUG RS - set dir perm to 493
</code></pre></div>
<p dir="auto">Got this panic output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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 aarch64
Version: 1.28.3
Args: [&quot;deno&quot;, &quot;test&quot;, &quot;--fail-fast=3&quot;, &quot;--allow-net&quot;, &quot;--allow-env&quot;, &quot;--allow-read&quot;, &quot;--unstable&quot;, &quot;--&quot;, &quot;--env&quot;, &quot;undefined&quot;]

thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 32, kind: BrokenPipe, message: &quot;Broken pipe&quot; }', cli/tools/test.rs:1650:56
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: core::result::Result&lt;T,E&gt;::unwrap
   4: deno::tools::test::TestOutputPipe::flush
   5: deno::tools::test::TestEventSender::send
   6: &lt;extern &quot;C&quot; fn(A0) .&gt; R as v8::support::CFnFrom&lt;F&gt;&gt;::mapping::c_fn
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: Uncaught Error: Command: &quot;deno test --fail-fast=3 --allow-net --allow-env --allow-read --unstable -- --env &quot; exited with code 1
    throw new Error(
          ^
    at Module.run (file:///Users/andrew/workspaces/ethf/bls-wallet/aggregator/programs/helpers/shell.ts:16:11)
    at async file:///Users/andrew/workspaces/ethf/bls-wallet/aggregator/programs/premerge.ts:34:7
    at async file:///Users/andrew/workspaces/ethf/bls-wallet/aggregator/programs/premerge.ts:15:3"><pre class="notranslate"><code class="notranslate">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 aarch64
Version: 1.28.3
Args: ["deno", "test", "--fail-fast=3", "--allow-net", "--allow-env", "--allow-read", "--unstable", "--", "--env", "undefined"]

thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }', cli/tools/test.rs:1650:56
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: core::result::Result&lt;T,E&gt;::unwrap
   4: deno::tools::test::TestOutputPipe::flush
   5: deno::tools::test::TestEventSender::send
   6: &lt;extern "C" fn(A0) .&gt; R as v8::support::CFnFrom&lt;F&gt;&gt;::mapping::c_fn
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: Uncaught Error: Command: "deno test --fail-fast=3 --allow-net --allow-env --allow-read --unstable -- --env " exited with code 1
    throw new Error(
          ^
    at Module.run (file:///Users/andrew/workspaces/ethf/bls-wallet/aggregator/programs/helpers/shell.ts:16:11)
    at async file:///Users/andrew/workspaces/ethf/bls-wallet/aggregator/programs/premerge.ts:34:7
    at async file:///Users/andrew/workspaces/ethf/bls-wallet/aggregator/programs/premerge.ts:15:3
</code></pre></div>
<p dir="auto">Since this is a broken pipe, I'm guessing this has to do with the <code class="notranslate">--fail-fast</code> option nuking a stream in a way that doesn't get handled correctly.</p>
<p dir="auto">This has reproduced every time for me so far. To reproduce:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="git clone git@github.com:web3well/bls-wallet
cd bls-wallet
git checkout 0bfaf98dfa4e0ad24ddebc5e687ea8e643729e38
cd aggregator
cp .env.example .env
./programs/premerge.ts"><pre class="notranslate"><code class="notranslate">git clone git@github.com:web3well/bls-wallet
cd bls-wallet
git checkout 0bfaf98dfa4e0ad24ddebc5e687ea8e643729e38
cd aggregator
cp .env.example .env
./programs/premerge.ts
</code></pre></div>
<p dir="auto">Running the test suite 'properly' requires some other set-up, but it's not necessary to reproduce the panic.</p>
<p dir="auto">To clarify, this bug involves some failing tests in my project, but they aren't caused by the deno bug (ie I'm not asking for help with my own tests).</p>