Skip to content

First test run in a session triggers slow discovery of all test suites #5879

@FMorschel

Description

@FMorschel

Describe the bug
After running a test file with test_reflective_loader, I see all gutter icons just fine, but if I right-click to debug a specific test, I see the Discovering Tests... status for a very long time.
Simply restarting the extension host reproduces it. I don't need to edit anything to see this behaviour (tested on the SDK just now).

To Reproduce
Steps to reproduce the behavior:

  1. Open a test_reflective_loader test file
  2. Run it fully
  3. Try using the gutter icon to debug a single test

Expected behavior
For it to immediately start the debugger (not needing to discover tests).

Extra
I'll see if I can profile the extension to send some more info here.

Please complete the following information:

Workspace Environment
Dart Code extension: 3.127.20260115
Flutter extension: 3.127.20251229 (activated)

App: Visual Studio Code
App Host: desktop
Version: win 1.108.1

Workspace type: Dart (LSP)
Workspace name: essential_lints

Dart (3.12.0-edge.2bfdb03c4afd1592ca3c35bfa8e87c19a9db0c95): C:\Users\felip_0vh5fa6\dart
Flutter (3.38.6): C:\Users\felip_0vh5fa6\.puro\envs\stable\flutter (No device)

Output from 'dart info'

C:\Users\felip_0vh5fa6\dart\bin\dart.exe info

If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.

General info

  • Dart 3.12.0-edge.2bfdb03c4afd1592ca3c35bfa8e87c19a9db0c95 (main) (Sat Jan 17 17:33:05 2026 -0800) on "windows_x64"
  • on windows / "Windows 11 Pro" 10.0 (Build 26200)
  • locale is pt-BR

Project info

  • sdk constraint: '^3.10.0'
  • dependencies: analysis_server_plugin, analyzer, essential_lints_annotations, logging, meta
  • dev_dependencies: analyzer_testing, frontend_server_client, test, test_reflective_loader, very_good_analysis

Process info

Memory CPU Elapsed time Command line
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dartvm.exe
0 MB -- dartvm.exe

Metadata

Metadata

Assignees

No one assigned

    Labels

    in testingRelates to test execution of Dart/Flutter tests for end usersis performance

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions