flutter / flutter/devtools

Add ability to observe active timers and microtask queues

未关闭
#2,152 3 条评论 7 个 reaction 已指派 0 人 在 GitHub 查看
g3 P3 screen: debugger
主要语言
Dart
星标
1.7k
派生
404
平均合并
6 天 17 小时
30 天内合并 PR
18

描述

[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.

贡献指南

打开贡献指南

调研方向

首先,在 DevTools 的 Dart 调试支持以及使用 runAsync 的 widget 测试的背景下审查该请求。确定在暂停时应如何表示活动计时器、微任务队列、创建位置和计时器状态;由于此处未确定任何文件或测试,完成条件是形成一致同意的设计和实施计划。

由索引模型根据 Issue 内容生成。

评估

技术栈
dart
领域
devtools
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。