Automatically select main isolate instead of the test runner isolate when connecting to test runs
維護者通常 2 天內回覆
還沒有人認領這個 Issue。
- #9756 來自 @rishika0212 —— 已關閉,未合併
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 48/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 冷清
- 技術堆疊
- dart
- 領域
- devtools, performance, testing
研究方向
按照報告中的中斷點和 CPU 分析步驟,使用 bin/main.dart 和 test/cpu_profile_test.dart 重現此問題。首先追蹤 DevTools 如何連線到測試執行並選取一個 isolate;當對測試執行進行分析能夠擷取 cpu_profile.calculate() 中的工作,並顯示如同獨立程式的資料時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
I don't know if this is a DevTools issue or something else, but I'm also not sure how to determine which.
When running tests, CPU profiling never seems to collect any data. For example given a sample project with a bin/main.dart that calls a function in lib that blocks for 5s, and a test that does the same:
bin/main.dart
import 'package:cpu_profile/cpu_profile.dart' as cpu_profile;
void main(List<String> arguments) {
print('starting'); // breakpoint
cpu_profile.calculate();
print('done!'); // breakpoint
}
lib/cpu_profile.dart
int calculate() {
var start = DateTime.now();
while (start.difference(DateTime.now()).inSeconds.abs() < 5) {}
return 6 * 7;
}
test/cpu_profile_test.dart
import 'package:cpu_profile/cpu_profile.dart' as cpu_profile;
import 'package:test/test.dart';
void main() {
test('calculate', () {
print('starting'); // breakpoint
cpu_profile.calculate();
print('done!'); // breakpoint
});
}
For bin/main.dart:
- Open
bin/main.dart - Add breakpoints on the marked lines
- Run in debug mode and hit the first breakpoint
- Open DevTools CPU profile, enable profiling, and start recording
- Resume execution and wait for it to hit the second breakpoint
- Stop CPU profiling and observe the results
Perform the same steps but using the test instead, and the profiler doesn't show any data:
- 主要語言
- Dart
- 星號
- 1.7k
- 分支
- 407
- 平均合併
- 3 天 14 小時
- 30 天內合併 PR
- 15
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
flutter/devtools 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 73/100
維護者通常 2 天內回覆
-
Check for modern web libraries to determine if an app is a web app可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉P1 type-code-health
難度 2/5 1-3 小時 新手友好度 85/100
flutter/devtools#9973 · 3 則留言 ·
維護者通常 2 天內回覆
-
cost: low P2 type-code-health
難度 2/5 1-3 小時 新手友好度 68/100
flutter/devtools#9942 · 3 則留言 ·
維護者通常 2 天內回覆
-
[Inspector V2] Widget properties tab highlight extends past its rounded edge可能重新可做 @theprantadutta 於 159 天前認領,目前沒有進行中的 PR。 未關閉contributions welcome cross-screen inspector-2.0-polish P2
難度 2/5 1-3 小時 新手友好度 65/100
flutter/devtools#8936 · 3 則留言 ·
維護者通常 2 天內回覆
-
cross-screen P3
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 2 天內回覆
相似的 Issue
-
area: ui feature priority: medium
難度 1/5 1 小時以內 新手友好度 90/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 63/100
AimesSoft/NipaPlay-Reload#1022 ·
維護者通常 1 天內回覆
-
`jwtPayload.roomConfiguration` returns null fields for tokens from LiveKit server SDKs可能已有人在做 @RaphaelFakhri 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
livekit/client-sdk-flutter#1243 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
maplibre/flutter-maplibre-gl#1094 ·
維護者通常 1 天內回覆
-
bug to check
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆