Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Automatically select main isolate instead of the test runner isolate when connecting to test runs

オープン
#9,747 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
dart

調査の方向性

レポートに記載されているブレークポイントと CPU プロファイリングの手順に従い、bin/main.dart と test/cpu_profile_test.dart で問題を再現します。まず、DevTools がテスト実行に接続して isolate を選択する仕組みを追跡します。完了条件は、テスト実行のプロファイリングで cpu_profile.calculate() 内の処理が取得され、スタンドアロンプログラムと同様のデータが表示されることです。

索引モデルが issue の本文から書いたものです。

説明

cross-screen P2

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
Image

Perform the same steps but using the test instead, and the profiler doesn't show any data:

Image
主要言語
Dart
スター
1.7k
フォーク
405
平均マージ
4日 21時間
マージ済み PR(30日)
15

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

flutter/devtools のほかの issue

flutter/devtools の issue をすべて見る

似ている issue

Dart の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。