helloadhavan/github_issues huggingface dataset:
Repository: electron/electron
Pull request: build: remove context-aware patch

#### Description of Change

This change was added more than 4 years ago, and developers have had more than enough time to adjust to the change added in Electron 9. Upstream has its own error message when users try to load non-context aware native modules in the renderer process, which is now sufficient moving forward:

> A non-context-aware native addon was loaded in a process that disallows them.

I don't believe our error message needs to reference the specific Electron issue that prompted the change at this point.

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: none

Changed files:
filename: patches/node/.patches
patch: @@ -6,7 +6,6 @@ pass_all_globals_through_require.patch
 build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch
 refactor_allow_embedder_overriding_of_internal_fs_calls.patch
 chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch
-chore_add_context_to_context_aware_module_prevention.patch
 fix_handle_boringssl_and_openssl_incompatibilities.patch
 fix_crypto_tests_to_run_with_bssl.patch
 fix_account_for_debugger_agent_race_condition.patch

filename: patches/node/chore_add_context_to_context_aware_module_prevention.patch
patch: @@ -1,35 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Samuel Attard <sattard@slack-corp.com>
-Date: Wed, 22 May 2019 13:34:18 -0700
-Subject: chore: add context to context aware module prevention
-
-This patch adds extra context to why we prevent non-context-aware Node.js
-modules from being used in the renderer process. This should be upstreamed as
-a customizable error message.
-
-diff --git a/src/node_binding.cc b/src/node_binding.cc
-index b5c0a93d83ab4d4f6792d0eb648e7198de874bcf..0fd01987c29b06b91944d18266ba67994c1fac45 100644
---- a/src/node_binding.cc
-+++ b/src/node_binding.cc
-@@ -4,6 +4,7 @@
- #include "node_builtins.h"
- #include "node_errors.h"
- #include "node_external_reference.h"
-+#include "node_process.h"
- #include "util.h"
- 
- #include <string>
-@@ -495,7 +496,12 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
-       if (mp->nm_context_register_func == nullptr) {
-         if (env->force_context_aware()) {
-           dlib->Close();
--          THROW_ERR_NON_CONTEXT_AWARE_DISABLED(env);
-+          char errmsg[1024];
-+          snprintf(errmsg,
-+                   sizeof(errmsg),
-+                   "Loading non-context-aware native module in renderer: '%s'. See https://github.com/electron/electron/issues/18397.",
-+                   *filename);
-+          env->ThrowError(errmsg);
-           return false;
-         }
-       }
Repository: nodejs/node
Pull request: test: buffer.indexOf: add more number cases

add some more cases that assert the success result is relative to the start of the Buffer and not the byteOffset parameter
existing number cases only checked 0 and -1 returns

discovered by https://github.com/oven-sh/bun/issues/17555


Changed files:
filename: test/parallel/test-buffer-indexof.js
patch: @@ -71,6 +71,11 @@ assert.strictEqual(b.indexOf('f', 5), 5);
 assert.strictEqual(b.indexOf('f', -1), 5);
 assert.strictEqual(b.indexOf('f', 6), -1);
 
+assert.strictEqual(b.indexOf(100, 2), 3);
+assert.strictEqual(b.indexOf(102, 5), 5);
+assert.strictEqual(b.indexOf(102, -1), 5);
+assert.strictEqual(b.indexOf(102, 6), -1);
+
 assert.strictEqual(b.indexOf(Buffer.from('d'), 2), 3);
 assert.strictEqual(b.indexOf(Buffer.from('f'), 5), 5);
 assert.strictEqual(b.indexOf(Buffer.from('f'), -1), 5);
Repository: facebook/react
Pull request: [Tests] `waitForThrow` should diff strings

Currently, `waitForThrow` tries to diff the expected value against the thrown value if it doesn't match. However if the expectation is a string, we are not diffing against the thrown message. This commit makes it so if we are matching against message we also diff against message.


Changed files:
filename: packages/internal-test-utils/ReactInternalTestUtils.js
patch: @@ -141,10 +141,18 @@ export async function waitForThrow(expectedError: mixed): mixed {
         typeof expectedError === 'string' &&
         typeof x === 'object' &&
         x !== null &&
-        typeof x.message === 'string' &&
-        x.message.includes(expectedError)
+        typeof x.message === 'string'
       ) {
-        return x;
+        if (x.message.includes(expectedError)) {
+          return x;
+        } else {
+          error.message = `
+Expected error was not thrown.
+
+${diff(expectedError, x.message)}
+`;
+          throw error;
+        }
       }
       error.message = `
 Expected error was not thrown.
Repository: ggml-org/llama.cpp
Pull request: CUDA cmake: add compiler flag to add lineinfo

Add `GGML_CUDA_DEBUG` which adds `-lineinfo` compiler flags. Useful to seeing source files in Nsight Compute GUI

Changed files:
filename: ggml/src/ggml-cuda/CMakeLists.txt
patch: @@ -120,6 +120,10 @@ if (CUDAToolkit_FOUND)
 
     set(CUDA_FLAGS -use_fast_math -extended-lambda)
 
+    if (GGML_CUDA_DEBUG)
+        list(APPEND CUDA_FLAGS -lineinfo)
+    endif()
+
     if (CUDAToolkit_VERSION VERSION_GREATER_EQUAL "12.8")
         # Options are:
         # - none (not recommended)
Repository: huggingface/transformers
Pull request: Fix `fsmt` tests

# What does this PR do?

I make comments in `Files changed` tab, but in short, the hub repo. safetensors files are broken.

Changed files:
filename: tests/models/fsmt/test_modeling_fsmt.py
patch: @@ -474,7 +474,16 @@ def get_tokenizer(self, mname):
 
     def get_model(self, mname):
         if mname not in self.models_cache:
-            self.models_cache[mname] = FSMTForConditionalGeneration.from_pretrained(mname).to(torch_device)
+            # The safetensors checkpoint on `facebook/wmt19-de-en` (and other repositories) has issues.
+            # Hub PRs are opened, see https://huggingface.co/facebook/wmt19-de-en/discussions/6
+            # We have asked Meta to merge them but no response yet:
+            # https://huggingface.slack.com/archives/C01NE71C4F7/p1749565278015529?thread_ts=1749031628.757929&cid=C01NE71C4F7
+            # Below is what produced the Hub PRs that work (loading without safetensors, saving the reloading)
+            model = FSMTForConditionalGeneration.from_pretrained(mname, use_safetensors=False)
+            with tempfile.TemporaryDirectory() as tmpdir:
+                model.save_pretrained(tmpdir)
+                self.models_cache[mname] = FSMTForConditionalGeneration.from_pretrained(tmpdir).to(torch_device)
+
             if torch_device == "cuda":
                 self.models_cache[mname].half()
         return self.models_cache[mname]
@@ -497,7 +506,7 @@ def test_inference_no_head(self):
         expected_slice = torch.tensor(
             [[-1.5753, -1.5753, 2.8975], [-0.9540, -0.9540, 1.0299], [-3.3131, -3.3131, 0.5219]]
         ).to(torch_device)
-        torch.testing.assert_close(output[:, :3, :3], expected_slice, rtol=TOLERANCE, atol=TOLERANCE)
+        torch.testing.assert_close(output[0, :3, :3], expected_slice, rtol=TOLERANCE, atol=TOLERANCE)
 
     def translation_setup(self, pair):
         text = {
@@ -512,6 +521,10 @@ def translation_setup(self, pair):
 
         src_text = text[src]
         tgt_text = text[tgt]
+        # To make `test_translation_pipeline_0_en_ru` pass in #38904. When translating it back to `en`, we get
+        # `Machine learning is fine, isn't it?`.
+        if (src, tgt) == ("en", "ru"):
+            tgt_text = "Машинное обучение - это прекрасно, не так ли?"
 
         tokenizer = self.get_tokenizer(mname)
         model = self.get_model(mname)
Repository: denoland/deno
Pull request: fix(ext/node): fix panic when invalid AES GCM key size

Fixes https://github.com/denoland/deno/issues/27807

Changed files:
filename: ext/node/ops/crypto/cipher.rs
patch: @@ -8,6 +8,7 @@ use aes::cipher::block_padding::Pkcs7;
 use aes::cipher::BlockDecryptMut;
 use aes::cipher::BlockEncryptMut;
 use aes::cipher::KeyIvInit;
+use aes::cipher::KeySizeUser;
 use deno_core::Resource;
 use digest::generic_array::GenericArray;
 use digest::KeyInit;
@@ -190,12 +191,20 @@ impl Cipher {
       "aes-192-ecb" => Aes192Ecb(Box::new(ecb::Encryptor::new(key.into()))),
       "aes-256-ecb" => Aes256Ecb(Box::new(ecb::Encryptor::new(key.into()))),
       "aes-128-gcm" => {
+        if key.len() != aes::Aes128::key_size() {
+          return Err(CipherError::InvalidKeyLength);
+        }
+
         let cipher =
           aead_gcm_stream::AesGcm::<aes::Aes128>::new(key.into(), iv);
 
         Aes128Gcm(Box::new(cipher))
       }
       "aes-256-gcm" => {
+        if key.len() != aes::Aes256::key_size() {
+          return Err(CipherError::InvalidKeyLength);
+        }
+
         let cipher =
           aead_gcm_stream::AesGcm::<aes::Aes256>::new(key.into(), iv);
 
@@ -406,12 +415,20 @@ impl Decipher {
       "aes-192-ecb" => Aes192Ecb(Box::new(ecb::Decryptor::new(key.into()))),
       "aes-256-ecb" => Aes256Ecb(Box::new(ecb::Decryptor::new(key.into()))),
       "aes-128-gcm" => {
+        if key.len() != aes::Aes128::key_size() {
+          return Err(DecipherError::InvalidKeyLength);
+        }
+
         let decipher =
           aead_gcm_stream::AesGcm::<aes::Aes128>::new(key.into(), iv);
 
         Aes128Gcm(Box::new(decipher))
       }
       "aes-256-gcm" => {
+        if key.len() != aes::Aes256::key_size() {
+          return Err(DecipherError::InvalidKeyLength);
+        }
+
         let decipher =
           aead_gcm_stream::AesGcm::<aes::Aes256>::new(key.into(), iv);
 

filename: tests/unit_node/crypto/crypto_cipher_gcm_test.ts
patch: @@ -143,3 +143,32 @@ Deno.test({
     );
   },
 });
+
+Deno.test({
+  name: "aes gcm with invalid key length",
+  fn() {
+    assertThrows(
+      () => {
+        crypto.createCipheriv(
+          "aes-128-gcm",
+          Buffer.alloc(15),
+          Buffer.alloc(12),
+        );
+      },
+      Error,
+      "Invalid key length",
+    );
+
+    assertThrows(
+      () => {
+        crypto.createCipheriv(
+          "aes-256-gcm",
+          Buffer.alloc(31),
+          Buffer.alloc(12),
+        );
+      },
+      Error,
+      "Invalid key length",
+    );
+  },
+});
Repository: ggml-org/llama.cpp
Pull request: musa: fix failures in test-backend-ops for mul_mat_id op

*Make sure to read the [contributing guidelines](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md) before submitting a PR*

Ref: https://github.com/ggml-org/llama.cpp/pull/15131

### Testing Done

ToT:

```
root@xiaodongye-s80:/ws# ./build/bin/test-backend-ops  | grep FAIL
ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 MUSA devices:
  Device 0: MTT S80, compute capability 2.1, VMM: yes
[MUL_MAT_ID] NMSE = 0.473073968 > 0.000500000   MUL_MAT_ID(type_a=f32,type_b=f32,n_mats=4,n_used=1,b=0,m=512,n=32,k=256): FAIL
[MUL_MAT_ID] NMSE = 0.602911949 > 0.000500000   MUL_MAT_ID(type_a=f32,type_b=f32,n_mats=4,n_used=1,b=1,m=512,n=32,k=256): FAIL
[MUL_MAT_ID] NMSE = 0.801315053 > 0.000500000   MUL_MAT_ID(type_a=f32,type_b=f32,n_mats=4,n_used=2,b=0,m=512,n=32,k=256): FAIL
[MUL_MAT_ID] NMSE = 2.501388765 > 0.000500000   MUL_MAT_ID(type_a=f32,type_b=f32,n_mats=4,n_used=2,b=1,m=512,n=32,k=256): FAIL
[MUL_MAT_ID] NMSE = 1.142949490 > 0.000500000   MUL_MAT_ID(type_a=f32,type_b=f32,n_mats=8,n_used=1,b=0,m=512,n=129,k=256): FAIL
[MUL_MAT_ID] NMSE = 0.820664836 > 0.000500000   MUL_MAT_ID(type_a=f32,type_b=f32,n_mats=8,n_used=1,b=1,m=512,n=129,k=256): FAIL
[MUL_MAT_ID] NMSE = 0.730463410 > 0.000500000   MUL_MAT_ID(type_a=f32,type_b=f32,n_mats=8,n_used=2,b=0,m=512,n=32,k=256): FAIL
[MUL_MAT_ID] NMSE = 1.249068448 > 0.000500000   MUL_MAT_ID(type_a=f32,type_b=f32,n_mats=8,n_used=2,b=1,m=512,n=32,k=256): FAIL
[MUL_MAT_ID] NMSE = 1.097372514 > 0.000500000   MUL_MAT_ID(type_a=f32,type_b=f32,n_mats=8,n_used=4,b=0,m=512,n=32,k=256): FAIL
[MUL_MAT_ID] NMSE = 0.734338886 > 0.000500000   MUL_MAT_ID(type_a=f32,type_b=f32,n_mats=8,n_used=4,b=1,m=512,n=32,k=256): FAIL
  Backend MUSA0: FAIL
FAIL
```

With this fix:

```
root@xiaodongye-s80:/ws# ./build/bin/test-backend-ops | grep FAIL
ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 MUSA devices:
  Device 0: MTT S80, compute capability 2.1, VMM: yes
```

Changed files:
filename: ggml/src/ggml-cuda/common.cuh
patch: @@ -312,11 +312,11 @@ static bool turing_mma_available(const int cc) {
 }
 
 static bool ampere_mma_available(const int cc) {
-    return cc < GGML_CUDA_CC_OFFSET_AMD && ggml_cuda_highest_compiled_arch(cc) >= GGML_CUDA_CC_AMPERE;
+    return GGML_CUDA_CC_IS_NVIDIA(cc) && ggml_cuda_highest_compiled_arch(cc) >= GGML_CUDA_CC_AMPERE;
 }
 
 static bool cp_async_available(const int cc) {
-    return cc < GGML_CUDA_CC_OFFSET_AMD && ggml_cuda_highest_compiled_arch(cc) >= GGML_CUDA_CC_AMPERE;
+    return GGML_CUDA_CC_IS_NVIDIA(cc) && ggml_cuda_highest_compiled_arch(cc) >= GGML_CUDA_CC_AMPERE;
 }
 
 static constexpr __device__ int ggml_cuda_get_physical_warp_size() {
Repository: facebook/react
Pull request: [DevTools] Replace deprecated `new-window` with `webContents.setWindowOpenHandler()`

## Summary

The electron package was recently upgraded from ^11.1.0 to ^23.1.2 (#26337). However, the WebContents `new-window` event – that is used in the react-devtools project – was deprecated in [v12.0.0](https://releases.electronjs.org/release/v12.0.0) and removed in [v22.2.0](https://releases.electronjs.org/release/v22.2.0). The event was replaced by `webContents.setWindowOpenHandler()`. This PR replaces the `new-window` event with `webContents.setWindowOpenHandler()`.

## How did you test this change?

I created a simple electron application with similar functionality:

```
const { app, BrowserWindow, shell } = require('electron')

const createWindow = () => {
  const mainWindow = new BrowserWindow({
    width: 800,
    height: 600
  })

  mainWindow.webContents.setWindowOpenHandler(({ url }) => {
    shell.openExternal(url)
    return { action: 'deny' }
  })

  mainWindow.loadFile('index.html')
}

app.whenReady().then(() => {
  createWindow()
})
```

Changed files:
filename: packages/react-devtools/app.js
patch: @@ -5,7 +5,7 @@
  * LICENSE file in the root directory of this source tree.
  */
 
-const {app, BrowserWindow} = require('electron'); // Module to create native browser window.
+const {app, BrowserWindow, shell} = require('electron'); // Module to create native browser window.
 const {join} = require('path');
 const os = require('os');
 
@@ -40,9 +40,9 @@ app.on('ready', function () {
   }
 
   // https://stackoverflow.com/questions/32402327/
-  mainWindow.webContents.on('new-window', function (event, url) {
-    event.preventDefault();
-    require('electron').shell.openExternal(url);
+  mainWindow.webContents.setWindowOpenHandler(({url}) => {
+    shell.openExternal(url);
+    return {action: 'deny'};
   });
 
   // and load the index.html of the app.
Repository: denoland/deno
Pull request: fix(ext/node): fix async variant of brotliDecompress

Fixes https://github.com/denoland/deno/issues/27729

Changed files:
filename: ext/node/polyfills/_brotli.js
patch: @@ -181,7 +181,6 @@ export function brotliCompress(
     callback = options;
     options = {};
   }
-
   const { quality, lgwin, mode } = oneOffCompressOptions(options);
   PromisePrototypeCatch(
     PromisePrototypeThen(
@@ -204,8 +203,13 @@ export function brotliCompressSync(
   return Buffer.from(TypedArrayPrototypeSubarray(output, 0, len));
 }
 
-export function brotliDecompress(input) {
+export function brotliDecompress(input, options, callback) {
   const buf = toU8(input);
+
+  if (typeof options === "function") {
+    callback = options;
+    options = {};
+  }
   return PromisePrototypeCatch(
     PromisePrototypeThen(
       op_brotli_decompress_async(buf),

filename: tests/unit_node/zlib_test.ts
patch: @@ -5,6 +5,7 @@ import { fromFileUrl, relative } from "@std/path";
 import {
   brotliCompress,
   brotliCompressSync,
+  brotliDecompress,
   brotliDecompressSync,
   constants,
   crc32,
@@ -35,7 +36,11 @@ Deno.test("brotli compression async", async () => {
     })
   );
   assertEquals(compressed instanceof Buffer, true);
-  const decompressed = brotliDecompressSync(compressed);
+  const decompressed: Buffer = await new Promise((resolve) =>
+    brotliDecompress(compressed, (_, res) => {
+      return resolve(res);
+    })
+  );
   assertEquals(decompressed.toString(), "hello world");
 });
Repository: facebook/react
Pull request: Clean up discrete event replaying

We no longer replay and discrete events.

I might re-add a form of this but it'll look a little different.

Changed files:
filename: packages/react-dom-bindings/src/events/ReactDOMEventListener.js
patch: @@ -57,7 +57,7 @@ import {isRootDehydrated} from 'react-reconciler/src/ReactFiberShellHydration';
 const {ReactCurrentBatchConfig} = ReactSharedInternals;
 
 // TODO: can we stop exporting these?
-export let _enabled: boolean = true;
+let _enabled: boolean = true;
 
 // This is exported in FB builds for use by legacy FB layer infra.
 // We'd like to remove this but it's not clear if this is safe.

filename: packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js
patch: @@ -60,11 +60,6 @@ type QueuedReplayableEvent = {
 
 let hasScheduledReplayAttempt = false;
 
-// The queue of discrete events to be replayed.
-const queuedDiscreteEvents: Array<QueuedReplayableEvent> = [];
-
-// Indicates if any continuous event targets are non-null for early bailout.
-const hasAnyQueuedContinuousEvents: boolean = false;
 // The last of each continuous event type. We only need to replay the last one
 // if the last target was dehydrated.
 let queuedFocus: null | QueuedReplayableEvent = null;
@@ -82,14 +77,6 @@ type QueuedHydrationTarget = {
 };
 const queuedExplicitHydrationTargets: Array<QueuedHydrationTarget> = [];
 
-export function hasQueuedDiscreteEvents(): boolean {
-  return queuedDiscreteEvents.length > 0;
-}
-
-export function hasQueuedContinuousEvents(): boolean {
-  return hasAnyQueuedContinuousEvents;
-}
-
 const discreteReplayableEvents: Array<DOMEventName> = [
   'mousedown',
   'mouseup',
@@ -446,21 +433,6 @@ function scheduleCallbackIfUnblocked(
 export function retryIfBlockedOn(
   unblocked: Container | SuspenseInstance,
 ): void {
-  // Mark anything that was blocked on this as no longer blocked
-  // and eligible for a replay.
-  if (queuedDiscreteEvents.length > 0) {
-    scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked);
-    // This is a exponential search for each boundary that commits. I think it's
-    // worth it because we expect very few discrete events to queue up and once
-    // we are actually fully unblocked it will be fast to replay them.
-    for (let i = 1; i < queuedDiscreteEvents.length; i++) {
-      const queuedEvent = queuedDiscreteEvents[i];
-      if (queuedEvent.blockedOn === unblocked) {
-        queuedEvent.blockedOn = null;
-      }
-    }
-  }
-
   if (queuedFocus !== null) {
     scheduleCallbackIfUnblocked(queuedFocus, unblocked);
   }
Repository: nodejs/node
Pull request: doc: add history entry for DEP0190 in `child_process.md`

I forgot to do that in the original PR

Refs: https://github.com/nodejs/node/pull/57389
<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: doc/api/child_process.md
patch: @@ -348,6 +348,10 @@ controller.abort();
 <!-- YAML
 added: v0.1.91
 changes:
+  - version:
+      - REPLACEME
+    pr-url: https://github.com/nodejs/node/pull/57389
+    description: Passing `args` when `shell` is set to `true` is deprecated.
   - version:
       - v16.4.0
       - v14.18.0
@@ -641,6 +645,10 @@ if (process.argv[2] === 'child') {
 <!-- YAML
 added: v0.1.90
 changes:
+  - version:
+      - REPLACEME
+    pr-url: https://github.com/nodejs/node/pull/57389
+    description: Passing `args` when `shell` is set to `true` is deprecated.
   - version:
       - v16.4.0
       - v14.18.0
Repository: vercel/next.js
Pull request: [test] Move test selectors as close to the actual value as possible (Part 2)

More stuff like https://github.com/vercel/next.js/pull/78931

Required for https://github.com/vercel/next.js/pull/80375

Changed files:
filename: test/e2e/app-dir/node-extensions/fixtures/random/dynamic-io/app/rewritten/page.tsx
patch: @@ -1,3 +1,3 @@
 export default async function Page() {
-  return <section>rewritten</section>
+  return <section data-testid="content">rewritten</section>
 }

filename: test/e2e/app-dir/node-extensions/fixtures/random/legacy/app/rewritten/page.tsx
patch: @@ -1,3 +1,3 @@
 export default async function Page() {
-  return <section>rewritten</section>
+  return <section data-testid="content">rewritten</section>
 }

filename: test/e2e/app-dir/node-extensions/node-extensions.random.test.ts
patch: @@ -13,12 +13,13 @@ describe('Node Extensions', () => {
       }
 
       it('should not error when accessing middlware that use Math.random()', async () => {
-        let res, $
+        let res: Awaited<ReturnType<typeof next.fetch>>,
+          $: Awaited<ReturnType<typeof next.render$>>
 
         res = await next.fetch('/rewrite')
         expect(res.status).toBe(200)
         $ = await next.render$('/rewrite')
-        expect($('main section').text()).toBe('rewritten')
+        expect($('[data-testid="content"]').text()).toBe('rewritten')
       })
 
       it('should not error when accessing pages that use Math.random() in App Router', async () => {
@@ -165,7 +166,7 @@ describe('Node Extensions', () => {
         res = await next.fetch('/rewrite')
         expect(res.status).toBe(200)
         $ = await next.render$('/rewrite')
-        expect($('main section').text()).toBe('rewritten')
+        expect($('[data-testid="content"]').text()).toBe('rewritten')
       })
 
       it('should not error when accessing pages that use Math.random() in App Router', async () => {