Skip to content

Fix auto select main isolate#9756

Open
rishika0212 wants to merge 4 commits intoflutter:masterfrom
rishika0212:fix-auto-select-main-isolate
Open

Fix auto select main isolate#9756
rishika0212 wants to merge 4 commits intoflutter:masterfrom
rishika0212:fix-auto-select-main-isolate

Conversation

@rishika0212
Copy link
Copy Markdown
Contributor

Fixes #9747

When DevTools connects to a test run, three isolates are present: the test runner (main), the test suite isolate where user code actually runs (test_suite:...), and vm-service. Previously, DevTools fell through to selecting the first isolate (main) as a fallback, so CPU profiling and other tools showed no data and the user's test code was running in a completely different isolate.

This changes _computeMainIsolate in IsolateManager to prefer thetest_suite: isolate when no Flutter extension or :main( isolate is found. The test_suite: prefix is set as a debugName by package:test_core when it spawns each test suite isolate, making it a reliable signal to detect test runs.

Before: CPU profiler showed empty results when connected to a test run.
After: CPU profiler correctly captures samples from the test suite isolate.

Pre-launch Checklist

General checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read the [Flutter Style Guide] recently, and have followed its advice.
  • I signed the [CLA].
  • I updated/added relevant documentation (doc comments with ///).

Issues checklist

  • I listed at least one issue that this PR fixes in the description above.
  • I listed at least one issue which has the [contributions-welcome] or [good-first-issue] label.
  • I did not list at least one issue with the [contributions-welcome] or [good-first-issue] label. I understand this means my PR might take longer to be reviewed.

Tests checklist

  • I added new tests to check the change I am making...
  • OR there is a reason for not adding tests, which I explained in the PR description.

AI-tooling checklist

  • I did not use any AI tooling in creating this PR.
  • OR I did use AI tooling, and...
    • I read the [AI contributions guidelines] and agree to follow them.
    • I reviewed all AI-generated code before opening this PR.
    • I understand and am able to discuss the code in this PR.
    • I have verifed the accuracy of any AI-generated text included in the PR description.
    • I commit to verifying the accuracy of any AI-generated code or text that I upload in response to review comments.

Feature-change checklist

  • This PR does not change the DevTools UI or behavior and...
    • I added the release-notes-not-required label or left a comment requesting the label be added.
  • OR this PR does change the DevTools UI or behavior and...
    • I added an entry to packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.
    • I included before/after screenshots and/or a GIF demo of the new UI to my PR description.
    • I ran the DevTools app locally to manually verify my changes.

@rishika0212 rishika0212 requested review from a team and kenzieschmoll as code owners April 3, 2026 11:00
@rishika0212 rishika0212 requested review from bkonyi and removed request for a team April 3, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant