Automatically select main isolate instead of the test runner isolate when connecting to test runs
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- dart
- Lĩnh vực
- devtools, performance, testing
Hướng nghiên cứu
Tái hiện sự cố với bin/main.dart và test/cpu_profile_test.dart, làm theo các bước về breakpoint và lập hồ sơ CPU trong báo cáo. Trước tiên, hãy theo dõi cách DevTools kết nối với một lần chạy kiểm thử và chọn một isolate; hoàn tất khi việc lập hồ sơ lần chạy kiểm thử ghi nhận phần xử lý trong cpu_profile.calculate() và hiển thị dữ liệu giống như chương trình độc lập.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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:
- Ngôn ngữ chính
- Dart
- Star
- 1.7k
- Fork
- 405
- Merge trung bình
- 4 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 15
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của flutter/devtools
-
cleanup P1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
`dcm analyze` false positives Đang mởa: quality cost: low P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
contributions welcome cross-screen inspector-2.0-polish P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Support removing storage keys Đang mởcross-screen P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
documentation good first issue P2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Tất cả issue của flutter/devtools
Issue tương tự
-
[Bug]: New version of nm package Đang mởbug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
fluttercommunity/plus_plugins#3979 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
from.page-issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
enhancement UI: Material
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Notsfsssf/pixez-flutter#1360 ·
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100