Idle: a test that waits on the runner's RPC (a dynamic import, vi.importActual) past 500 ms is killed by no progress

Offen
#148 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
javascript
Bereich
devtools, testing

Rechercherichtung

Read packages/oracles/oracle-gaps/capture-setup.mjs, focusing on the testsIo and testsTimerDue sampler, then trace how worker RPC calls are started from a test frame. Build the proposed witness history with the driver holding a module fetch reply past the idle window by a count rather than elapsed time. Done means the pending test-started RPC prevents the no progress kill, with the e2e oracle recording the case in its Limits.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

What happens

Under #99 (deterministic cuts), a mutant copy is idle when no timer that the test started is due inside its horizon and no I/O handle or request that the test started is open (v21.2 R51; M entries "Idle is decided by state only" and "Idle counts only the test's I/O"). Idle for 500 ms (IDLE_MS) is a kill by the built-in law no progress (M-24).

A test can wait on a reply over the runner's own channel. Examples: a dynamic import(), vi.importActual, or a mocked module's importOriginal. Each one fetches and transforms a module over Vitest's worker RPC. While the test waits, no test-owned timer or I/O is pending: the request goes out on the runner's channel, which is the runner's resource, and the pending reply is a promise, which the async_hooks hook does not record.

So a copy whose reply takes more than 500 ms is killed by no progress. On a loaded CLI main thread (16 contexts that transform instrumented copies), a reply can take that long. The kill then depends on load, against I15.

The law

M "Idle counts only the test's I/O": "a copy is idle when its test can't make progress without a timer firing". A test that waits for a reply that will come is not idle under that rule.

Where

  • packages/oracles/oracle-gaps/capture-setup.mjs: the sampler (testsIo, testsTimerDue).
  • The e2e oracle records the case in its Limits; no history reaches it.

What would close it

  • Count a pending runner RPC that the test's code started as the test's own pending work. One way: count the worker RPC calls in flight that a test frame started.
  • A witness: a constructed history whose test awaits a module fetch that the driver holds past the idle window by a count, not by time.

Found in the merge-gate review of #99 (M3). Recorded in #99's Limits with this issue as its owner.

Vorherrschende Sprache
JavaScript
Sterne
5
Forks
1
Ø Merge
11 Std. 18 Min.
Gemergte PRs (30 T.)
66

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TanStack/oracles

Alle Issues in TanStack/oracles

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.