flutter / flutter/devtools

Add ability to observe active timers and microtask queues

Offen
#2,152 3 Kommentare 7 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
g3 P3 screen: debugger
Vorherrschende Sprache
Dart
Sterne
1.7k
Forks
404
Ø Merge
6 T. 17 Std.
Gemergte PRs (30 T.)
18

Beschreibung

[I am filing within the context of widget tests but I believe this is useful in general for debugging Dart code.]

Certain Widget tests use `runAsync` to run code in real async zone. These tests are often flaky and developers have a hard time understanding why. Most often the culprit is some Timer or Microtask that causes a side-effect that the test depends on. If this task does not run in time, it hangs the test.

When I was debugging an issue like this, I had to instrument `ZoneSpecification` to figure out what was creating the timers and microtasks. This is advanced debugging for a regular user who often does not understand zones.

The request here is to be able to see active timers and the microtask queue of the current zone when the code is paused at a breakpoint. It would also be helpful to see *all* Timers and microtasks but this might be more confusing than helpful. When the user taps on a timer it would be useful to see where the timer was originally created and what its current state is.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, die Anfrage im Kontext von DevTools' Unterstützung beim Dart-Debugging und von Widget-Tests mit runAsync zu prüfen. Bestimme, wie aktive Timer, Microtask-Warteschlangen, Erstellungsorte und der Timerstatus während des Pausierens dargestellt werden sollten. Als abgeschlossen gilt die Aufgabe, wenn ein abgestimmtes Design und ein Implementierungsplan vorliegen, da hier keine Dateien oder Tests angegeben sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
dart
Bereich
devtools
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

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