helloadhavan/github_issues huggingface dataset:
Repository: huggingface/transformers
Pull request: Raising error when quantizing a quantized model

# What does this PR do?

This pr raises error if we try to quantize a quantized model using a different quantization method

Changed files:
filename: src/transformers/quantizers/auto.py
patch: @@ -213,6 +213,12 @@ def merge_quantization_configs(
             else:
                 quantization_config = AutoQuantizationConfig.from_dict(quantization_config)
 
+        if quantization_config.__class__.__name__ != quantization_config_from_args.__class__.__name__:
+            raise ValueError(
+                f"The model is quantized with {quantization_config.__class__.__name__} but you are passing a {quantization_config_from_args.__class__.__name__} config. "
+                "Please make sure to pass the same quantization config class to `from_pretrained` with different loading attributes."
+            )
+
         if (
             isinstance(
                 quantization_config,
Repository: facebook/react
Pull request: Annotate legacy mode tests in ReactDOMInput


Changed files:
filename: packages/react-dom/src/__tests__/ReactDOMInput-test.js
patch: @@ -1707,7 +1707,7 @@ describe('ReactDOMInput', () => {
     assertInputTrackingIsCurrent(container);
   });
 
-  it('should control radio buttons if the tree updates during render', () => {
+  it('should control radio buttons if the tree updates during render in legacy mode', async () => {
     container.remove();
     container = document.createElement('div');
     document.body.appendChild(container);
Repository: ollama/ollama
Pull request: if directory cannot be resolved, do not fail

allow for offline mode

Changed files:
filename: api/client.go
patch: @@ -106,6 +106,11 @@ func (c *Client) Pull(ctx context.Context, req *PullRequest, fn PullProgressFunc
 				return err
 			}
 
+			if resp.Error.Message != "" {
+				// couldn't pull the model from the directory, proceed anyway
+				return nil
+			}
+
 			return fn(resp)
 		}),
 	)

filename: api/types.go
patch: @@ -26,6 +26,7 @@ type PullProgress struct {
 	Total     int64   `json:"total"`
 	Completed int64   `json:"completed"`
 	Percent   float64 `json:"percent"`
+	Error     Error   `json:"error"`
 }
 
 type GenerateRequest struct {

filename: server/routes.go
patch: @@ -3,12 +3,14 @@ package server
 import (
 	"embed"
 	"encoding/json"
+	"errors"
 	"fmt"
 	"io"
 	"log"
 	"math"
 	"net"
 	"net/http"
+	"os"
 	"path"
 	"runtime"
 	"strings"
@@ -25,6 +27,15 @@ import (
 var templatesFS embed.FS
 var templates = template.Must(template.ParseFS(templatesFS, "templates/*.prompt"))
 
+func cacheDir() string {
+	home, err := os.UserHomeDir()
+	if err != nil {
+		panic(err)
+	}
+
+	return path.Join(home, ".ollama")
+}
+
 func generate(c *gin.Context) {
 	var req api.GenerateRequest
 	req.ModelOptions = api.DefaultModelOptions
@@ -37,9 +48,16 @@ func generate(c *gin.Context) {
 	if remoteModel, _ := getRemote(req.Model); remoteModel != nil {
 		req.Model = remoteModel.FullName()
 	}
+	if _, err := os.Stat(req.Model); err != nil {
+		if !errors.Is(err, os.ErrNotExist) {
+			c.JSON(http.StatusBadRequest, gin.H{"message": err.Error()})
+			return
+		}
+		req.Model = path.Join(cacheDir(), "models", req.Model+".bin")
+	}
 
 	modelOpts := getModelOpts(req)
-	modelOpts.NGPULayers = 1  // hard-code this for now
+	modelOpts.NGPULayers = 1 // hard-code this for now
 
 	model, err := llama.New(req.Model, modelOpts)
 	if err != nil {
@@ -118,6 +136,17 @@ func Serve(ln net.Listener) error {
 		go func() {
 			defer close(progressCh)
 			if err := pull(req.Model, progressCh); err != nil {
+				var opError *net.OpError
+				if errors.As(err, &opError) {
+					result := api.PullProgress{
+						Error: api.Error{
+							Code:    http.StatusBadGateway,
+							Message: "failed to get models from directory",
+						},
+					}
+					c.JSON(http.StatusBadGateway, result)
+					return
+				}
 				c.JSON(http.StatusBadRequest, gin.H{"message": err.Error()})
 				return
 			}
Repository: denoland/deno
Pull request: fix(ext/node): propagate 'close' event of IncomingMessage to Socket

closes #28530

In the current `http.request` implementation, we don't use underlying `Socket` class in normal way (We pass the rid (TcpConn/TlsConn) of it to hyper, and let hyper directly use it).

Because of that, 'close' event is never emitted on socket. That causes the socket leak in http agent, and that prevents some http agent for creating more sockets than `maxSockets` number (`maxSockets` is `Infinity` by default though).

`@npmcli/agent` (the agent of npm cli) is one of such agent, affected by this bug. It sets 15 to `macSockets` (ref: https://github.com/npm/agent/blob/3c71f9adb0cce1ec228c2de0ce420e4c86f7fe46/lib/options.js#L14 ), and it caused the issue #28530 

This PR fixes the above issue by propagating 'close' event from `IncomingMessage(ForClient)` to underlying `Socket` object.

Changed files:
filename: ext/node/polyfills/http.ts
patch: @@ -1001,6 +1001,10 @@ export class IncomingMessageForClient extends NodeReadable {
     // Flag for when we decide that this message cannot possibly be
     // read by the user, so there's no point continuing to handle it.
     this._dumped = false;
+
+    this.on("close", () => {
+      this.socket.emit("close");
+    });
   }
 
   get connection() {

filename: tests/unit_node/http_test.ts
patch: @@ -1945,3 +1945,18 @@ Deno.test("[node/http] supports proxy http request", async () => {
   await promise;
   await server.finished;
 });
+
+Deno.test("[node/http] 'close' event is emitted when request finished", async () => {
+  const { promise, resolve } = Promise.withResolvers<void>();
+  let socketCloseEmitted = false;
+  const req = http.request("http://localhost:4545/echo.ts", async (res) => {
+    res.on("close", resolve);
+    req.socket?.on("close", () => {
+      socketCloseEmitted = true;
+    });
+    await text(res);
+  });
+  req.end();
+  await promise;
+  assert(socketCloseEmitted);
+});
Repository: ollama/ollama
Pull request: return error in generate response


Changed files:
filename: api/client.go
patch: @@ -5,6 +5,7 @@ import (
 	"bytes"
 	"context"
 	"encoding/json"
+	"fmt"
 	"io"
 	"net/http"
 	"net/url"
@@ -25,6 +26,18 @@ func NewClient(hosts ...string) *Client {
 	}
 }
 
+func StatusError(status int, message ...string) error {
+	if status < 400 {
+		return nil
+	}
+
+	if len(message) > 0 && len(message[0]) > 0 {
+		return fmt.Errorf("%d %s: %s", status, http.StatusText(status), message[0])
+	}
+
+	return fmt.Errorf("%d %s", status, http.StatusText(status))
+}
+
 type options struct {
 	requestBody  io.Reader
 	responseFunc func(bts []byte) error
@@ -70,7 +83,20 @@ func (c *Client) stream(ctx context.Context, method, path string, fns ...func(*o
 	if opts.responseFunc != nil {
 		scanner := bufio.NewScanner(response.Body)
 		for scanner.Scan() {
-			if err := opts.responseFunc(scanner.Bytes()); err != nil {
+			var errorResponse struct {
+				Error string `json:"error"`
+			}
+
+			bts := scanner.Bytes()
+			if err := json.Unmarshal(bts, &errorResponse); err != nil {
+				return err
+			}
+
+			if err := StatusError(response.StatusCode, errorResponse.Error); err != nil {
+				return err
+			}
+
+			if err := opts.responseFunc(bts); err != nil {
 				return err
 			}
 		}

filename: api/types.go
patch: @@ -15,6 +15,7 @@ func (e Error) Error() string {
 	if e.Message == "" {
 		return fmt.Sprintf("%d %v", e.Code, strings.ToLower(http.StatusText(int(e.Code))))
 	}
+
 	return e.Message
 }
 

filename: cmd/cmd.go
patch: @@ -100,14 +100,19 @@ func generate(model, prompt string) error {
 			}
 		}()
 
-		client.Generate(context.Background(), &api.GenerateRequest{Model: model, Prompt: prompt}, func(resp api.GenerateResponse) error {
+		request := api.GenerateRequest{Model: model, Prompt: prompt}
+		fn := func(resp api.GenerateResponse) error {
 			if !spinner.IsFinished() {
 				spinner.Finish()
 			}
 
 			fmt.Print(resp.Response)
 			return nil
-		})
+		}
+
+		if err := client.Generate(context.Background(), &request, fn); err != nil {
+			return err
+		}
 
 		fmt.Println()
 		fmt.Println()

filename: server/routes.go
patch: @@ -4,7 +4,6 @@ import (
 	"embed"
 	"encoding/json"
 	"errors"
-	"fmt"
 	"io"
 	"log"
 	"math"
@@ -46,7 +45,7 @@ func generate(c *gin.Context) {
 		req.PredictOptions = &api.DefaultPredictOptions
 	}
 	if err := c.ShouldBindJSON(&req); err != nil {
-		c.JSON(http.StatusBadRequest, gin.H{"message": err.Error()})
+		c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
 		return
 	}
 
@@ -66,7 +65,7 @@ func generate(c *gin.Context) {
 
 	model, err := llama.New(req.Model, modelOpts)
 	if err != nil {
-		fmt.Println("Loading the model failed:", err.Error())
+		c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
 		return
 	}
 	defer model.Free()
@@ -80,7 +79,7 @@ func generate(c *gin.Context) {
 	if template := templates.Lookup(match); template != nil {
 		var sb strings.Builder
 		if err := template.Execute(&sb, req); err != nil {
-			fmt.Println("Prompt template failed:", err.Error())
+			c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
 			return
 		}
Repository: electron/electron
Pull request: perf: avoid `std::map` temporaries in `IsDevToolsFileSystemAdded()`

Backport of #46230

See that PR for details.


Notes: none.

Changed files:
filename: shell/browser/api/electron_api_web_contents.cc
patch: @@ -674,13 +674,16 @@ PrefService* GetPrefService(content::WebContents* web_contents) {
   return static_cast<electron::ElectronBrowserContext*>(context)->prefs();
 }
 
+// returns a Dict of filesystem_path -> type
+[[nodiscard]] const base::Value::Dict& GetAddedFileSystems(
+    content::WebContents* web_contents) {
+  return GetPrefService(web_contents)->GetDict(prefs::kDevToolsFileSystemPaths);
+}
+
 std::map<std::string, std::string> GetAddedFileSystemPaths(
     content::WebContents* web_contents) {
-  auto* pref_service = GetPrefService(web_contents);
-  const base::Value::Dict& file_system_paths =
-      pref_service->GetDict(prefs::kDevToolsFileSystemPaths);
   std::map<std::string, std::string> result;
-  for (auto it : file_system_paths) {
+  for (auto it : GetAddedFileSystems(web_contents)) {
     std::string type =
         it.second.is_string() ? it.second.GetString() : std::string();
     result[it.first] = type;
@@ -689,8 +692,8 @@ std::map<std::string, std::string> GetAddedFileSystemPaths(
 }
 
 bool IsDevToolsFileSystemAdded(content::WebContents* web_contents,
-                               const std::string& file_system_path) {
-  return GetAddedFileSystemPaths(web_contents).contains(file_system_path);
+                               const std::string_view file_system_path) {
+  return GetAddedFileSystems(web_contents).contains(file_system_path);
 }
 
 content::RenderFrameHost* GetRenderFrameHost(
Repository: electron/electron
Pull request: perf: avoid `std::map` temporaries in `IsDevToolsFileSystemAdded()`

#### Description of Change

`IsDevToolsFileSystemAdded()` wants to know if a `const base::Value::Dict&` provided by Chromium contains an item.  This PR does that by calling `dict.contains(item)`. Previously, it was done by creating single-use temporary `std::map` and then calling `map.contains(item)`.

`IsDevToolsFileSystemAdded()` is used by:

- `WebContents::DevToolsAddFileSystem()`
- `WebContents::DevToolsIndexPath()`
- `WebContents::DevToolsSearchInPath()`

#### Checklist

- [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: shell/browser/api/electron_api_web_contents.cc
patch: @@ -676,13 +676,16 @@ PrefService* GetPrefService(content::WebContents* web_contents) {
   return static_cast<electron::ElectronBrowserContext*>(context)->prefs();
 }
 
+// returns a Dict of filesystem_path -> type
+[[nodiscard]] const base::Value::Dict& GetAddedFileSystems(
+    content::WebContents* web_contents) {
+  return GetPrefService(web_contents)->GetDict(prefs::kDevToolsFileSystemPaths);
+}
+
 std::map<std::string, std::string> GetAddedFileSystemPaths(
     content::WebContents* web_contents) {
-  auto* pref_service = GetPrefService(web_contents);
-  const base::Value::Dict& file_system_paths =
-      pref_service->GetDict(prefs::kDevToolsFileSystemPaths);
   std::map<std::string, std::string> result;
-  for (auto it : file_system_paths) {
+  for (auto it : GetAddedFileSystems(web_contents)) {
     std::string type =
         it.second.is_string() ? it.second.GetString() : std::string();
     result[it.first] = type;
@@ -691,8 +694,8 @@ std::map<std::string, std::string> GetAddedFileSystemPaths(
 }
 
 bool IsDevToolsFileSystemAdded(content::WebContents* web_contents,
-                               const std::string& file_system_path) {
-  return GetAddedFileSystemPaths(web_contents).contains(file_system_path);
+                               const std::string_view file_system_path) {
+  return GetAddedFileSystems(web_contents).contains(file_system_path);
 }
 
 content::RenderFrameHost* GetRenderFrameHost(
Repository: vercel/next.js
Pull request: Update Rspack development test manifest

This auto-generated PR updates the development integration test manifest used when testing Rspack.

Changed files:
filename: test/rspack-dev-tests-manifest.json
patch: @@ -3052,6 +3052,15 @@
     "flakey": [],
     "runtimeError": false
   },
+  "test/development/app-dir/turbopack-loader-file-dependencies/turbopack-loader-file-dependencies.test.ts": {
+    "passed": [
+      "turbopack-loader-file-dependencies should update when the dependency file changes"
+    ],
+    "failed": [],
+    "pending": [],
+    "flakey": [],
+    "runtimeError": false
+  },
   "test/development/app-dir/typed-env/typed-env-prod.test.ts": {
     "passed": ["typed-env should have env types from next config"],
     "failed": [],
@@ -5558,7 +5567,7 @@
       "app-dir static/dynamic handling useSearchParams client should have empty search params on force-static"
     ],
     "flakey": [],
-    "runtimeError": true
+    "runtimeError": false
   },
   "test/e2e/app-dir/app-validation/validation.test.ts": {
     "passed": [
@@ -6537,6 +6546,15 @@
     "flakey": [],
     "runtimeError": false
   },
+  "test/e2e/app-dir/duplicate-layout-components/duplicate-layout-components.test.js": {
+    "passed": [
+      "app dir - duplicate layout components should not duplicate layout elements when navigating to 404"
+    ],
+    "failed": [],
+    "pending": [],
+    "flakey": [],
+    "runtimeError": false
+  },
   "test/e2e/app-dir/dynamic-css/index.test.ts": {
     "passed": [
       "app dir - dynamic css should not throw with accessing to ALS in preload css",
@@ -9760,6 +9778,24 @@
     "flakey": [],
     "runtimeError": false
   },
+  "test/e2e/app-dir/segment-cache/prefetch-layout-sharing/prefetch-layout-sharing.test.ts": {
+    "passed": [
+      "layout sharing in non-static prefetches disabled in development"
+    ],
+    "failed": [],
+    "pending": [],
+    "flakey": [],
+    "runtimeError": false
+  },
+  "test/e2e/app-dir/segment-cache/prefetch-runtime/prefetch-runtime.test.ts": {
+    "passed": [
+      "<Link prefetch={true}> (runtime prefetch) disabled in development"
+    ],
+    "failed": [],
+    "pending": [],
+    "flakey": [],
+    "runtimeError": false
+  },
   "test/e2e/app-dir/segment-cache/prefetch-scheduling/prefetch-scheduling.test.ts": {
     "passed": ["segment cache prefetch scheduling prefetching is disabled"],
     "failed": [],
Repository: ollama/ollama
Pull request: no prompt on empty line


Changed files:
filename: cmd/cmd.go
patch: @@ -9,6 +9,7 @@ import (
 	"net"
 	"os"
 	"path"
+	"strings"
 	"time"
 
 	"github.com/schollz/progressbar/v3"
@@ -75,38 +76,41 @@ func RunGenerate(_ *cobra.Command, args []string) error {
 }
 
 func generate(model, prompt string) error {
-	client := api.NewClient()
-
-	spinner := progressbar.NewOptions(-1,
-		progressbar.OptionSetWriter(os.Stderr),
-		progressbar.OptionThrottle(60*time.Millisecond),
-		progressbar.OptionSpinnerType(14),
-		progressbar.OptionSetRenderBlankState(true),
-		progressbar.OptionSetElapsedTime(false),
-		progressbar.OptionClearOnFinish(),
-	)
-
-	go func() {
-		for range time.Tick(60 * time.Millisecond) {
-			if spinner.IsFinished() {
-				break
+	if len(strings.TrimSpace(prompt)) > 0 {
+		client := api.NewClient()
+
+		spinner := progressbar.NewOptions(-1,
+			progressbar.OptionSetWriter(os.Stderr),
+			progressbar.OptionThrottle(60*time.Millisecond),
+			progressbar.OptionSpinnerType(14),
+			progressbar.OptionSetRenderBlankState(true),
+			progressbar.OptionSetElapsedTime(false),
+			progressbar.OptionClearOnFinish(),
+		)
+
+		go func() {
+			for range time.Tick(60 * time.Millisecond) {
+				if spinner.IsFinished() {
+					break
+				}
+
+				spinner.Add(1)
 			}
+		}()
 
-			spinner.Add(1)
-		}
-	}()
+		client.Generate(context.Background(), &api.GenerateRequest{Model: model, Prompt: prompt}, func(resp api.GenerateResponse) error {
+			if !spinner.IsFinished() {
+				spinner.Finish()
+			}
 
-	client.Generate(context.Background(), &api.GenerateRequest{Model: model, Prompt: prompt}, func(resp api.GenerateResponse) error {
-		if !spinner.IsFinished() {
-			spinner.Finish()
-		}
+			fmt.Print(resp.Response)
+			return nil
+		})
 
-		fmt.Print(resp.Response)
-		return nil
-	})
+		fmt.Println()
+		fmt.Println()
+	}
 
-	fmt.Println()
-	fmt.Println()
 	return nil
 }
 

filename: server/templates/wizardlm.prompt
patch: @@ -1,2 +1,3 @@
 {{ .Prompt }}
+
 ### Response:
Repository: facebook/react
Pull request: Remove ReactTestUtils from ReactComponentLifeCycle


Changed files:
filename: packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js
patch: @@ -14,7 +14,6 @@ let act;
 let React;
 let ReactDOM;
 let ReactDOMClient;
-let ReactTestUtils;
 let PropTypes;
 
 const clone = function (o) {
@@ -97,7 +96,6 @@ describe('ReactComponentLifeCycle', () => {
     React = require('react');
     ReactDOM = require('react-dom');
     ReactDOMClient = require('react-dom/client');
-    ReactTestUtils = require('react-dom/test-utils');
     PropTypes = require('prop-types');
   });
 
@@ -189,7 +187,7 @@ describe('ReactComponentLifeCycle', () => {
 
   // You could assign state here, but not access members of it, unless you
   // had provided a getInitialState method.
-  it('throws when accessing state in componentWillMount', () => {
+  it('throws when accessing state in componentWillMount', async () => {
     class StatefulComponent extends React.Component {
       UNSAFE_componentWillMount() {
         void this.state.yada;
@@ -200,10 +198,13 @@ describe('ReactComponentLifeCycle', () => {
       }
     }
 
-    let instance = <StatefulComponent />;
-    expect(function () {
-      instance = ReactTestUtils.renderIntoDocument(instance);
-    }).toThrow();
+    const container = document.createElement('div');
+    const root = ReactDOMClient.createRoot(container);
+    await expect(
+      act(() => {
+        root.render(<StatefulComponent />);
+      }),
+    ).rejects.toThrow();
   });
 
   it('should allow update state inside of componentWillMount', () => {
@@ -217,9 +218,13 @@ describe('ReactComponentLifeCycle', () => {
       }
     }
 
-    let instance = <StatefulComponent />;
-    expect(function () {
-      instance = ReactTestUtils.renderIntoDocument(instance);
+    expect(async function () {
+      const container = document.createElement('div');
+      const root = ReactDOMClient.createRoot(container);
+
+      await act(() => {
+        root.render(<StatefulComponent />);
+      });
     }).not.toThrow();
   });
 
@@ -557,7 +562,7 @@ describe('ReactComponentLifeCycle', () => {
     });
   });
 
-  it('should allow state updates in componentDidMount', () => {
+  it('should allow state updates in componentDidMount', async () => {
     /**
      * calls setState in an componentDidMount.
      */
@@ -575,13 +580,19 @@ describe('ReactComponentLifeCycle', () => {
       }
     }
 
-    let instance = (
-      <SetStateInComponentDidMount
-        valueToUseInitially="hello"
-        valueToUseInOnDOMReady="goodbye"
-      />
-    );
-    instance = ReactTestUtils.renderIntoDocument(instance);
+    let instance;
+    const container = document.createElement('div');
+    const root = ReactDOMClient.createRoot(container);
+    await act(() => {
+      root.render(
+        <SetStateInComponentDidMount
+          ref={current => (instance = current)}
+          valueToUseInitially="hello"
+          valueToUseInOnDOMReady="goodbye"
+        />,
+      );
+    });
+
     expect(instance.state.stateField).toBe('goodbye');
   });
Repository: nodejs/node
Pull request: test: fix test-abortsignal-drop-settled-signals flakiness

Refs #56190
Fixes #56190

Changed files:
filename: test/parallel/test-abortsignal-drop-settled-signals.mjs
patch: @@ -1,6 +1,7 @@
 // Flags: --expose_gc
 //
 import '../common/index.mjs';
+import { gcUntil } from '../common/gc.js';
 import { describe, it } from 'node:test';
 
 function makeSubsequentCalls(limit, done, holdReferences = false) {
@@ -141,37 +142,29 @@ it('drops settled dependant signals when signal is composite', (t, done) => {
   );
 
   setImmediate(() => {
-    global.gc();
+    global.gc({ execution: 'async' }).then(() => {
+      t.assert.strictEqual(composedSignalRef.deref(), undefined);
+      t.assert.strictEqual(controllers[0].signal[kDependantSignals].size, 2);
+      t.assert.strictEqual(controllers[1].signal[kDependantSignals].size, 1);
 
-    t.assert.strictEqual(composedSignalRef.deref(), undefined);
-    t.assert.strictEqual(controllers[0].signal[kDependantSignals].size, 2);
-    t.assert.strictEqual(controllers[1].signal[kDependantSignals].size, 1);
-
-    setImmediate(() => {
-      t.assert.strictEqual(controllers[0].signal[kDependantSignals].size, 0);
-      t.assert.strictEqual(controllers[1].signal[kDependantSignals].size, 0);
+      setImmediate(() => {
+        t.assert.strictEqual(controllers[0].signal[kDependantSignals].size, 0);
+        t.assert.strictEqual(controllers[1].signal[kDependantSignals].size, 0);
 
-      done();
+        done();
+      });
     });
   });
 });
 
 it('drops settled signals even when there are listeners', (t, done) => {
-  runWithOrphanListeners(limit, (signalRefs) => {
-    setImmediate(() => {
-      global.gc();
-      setImmediate(() => {
-        global.gc(); // One more call needed to clean up the deeper composed signals
-        setImmediate(() => {
-          global.gc(); // One more call needed to clean up the deeper composed signals
-
-          const unGCedSignals = [...signalRefs].filter((ref) => ref.deref());
-
-          t.assert.strictEqual(unGCedSignals.length, 0);
+  runWithOrphanListeners(limit, async (signalRefs) => {
+    await gcUntil('all signals are GCed', () => {
+      const unGCedSignals = [...signalRefs].filter((ref) => ref.deref());
 
-          done();
-        });
-      });
+      return unGCedSignals.length === 0;
     });
+
+    done();
   });
 });