Repository navigation
Timeouts are not ignored when debugging tests inside Pub Workspaces #5620
Copy link
Copy link
Closed
Labels
in testingRelates to test execution of Dart/Flutter tests for end usersRelates to test execution of Dart/Flutter tests for end usersis bug
Milestone
Description
Describe the bug
When running SDK tests, I constantly see test timeout exceptions when debugging them.
To Reproduce
Steps to reproduce the behavior:
- Go to any
test_reflective_loadertest likepkg/analysis_server/test/src/services/correction/fix/remove_async_test.dart - Add:
@Timeout(Duration(seconds: 5))
library;
import 'package:test/test.dart';
//...
@reflectiveTest
class RemoveAsyncIllegalReturnTest extends FixProcessorTest {
@override
FixKind get kind => DartFixKind.REMOVE_ASYNC;
@soloTest
void test_a() {
print(''); // B1
print(''); // B2
}
@soloTest
Future<void> test_b() async {
print(''); // B3
await Future.delayed(Duration.zero);
print(''); // B4
}
//...- Run the test and wait more than five seconds between
B1andB2, see no problems - Run the test and wait more than five seconds between
B3andB4, see timeout
Expected behavior
Test timeout should be disabled when the debugger is running.
Please complete the following information:
Workspace Environment
Dart Code extension: 3.115.20250728
Flutter extension: 3.115.20250701 (activated)
App: Visual Studio Code
App Host: desktop
Version: win 1.102.3
Workspace type: Dart (LSP) (Multiroot)
Workspace name: sdk (Workspace)
Dart (3.10.0-edge.2bd721707305288f80bcaeec1834cdfcb71885b7): C:\Users\felip_0vh5fa6\dart
Flutter (3.32.7): 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.10.0-edge.2bd721707305288f80bcaeec1834cdfcb71885b7 (main) (Fri Jul 25 09:44:17 2025 -0700) on "windows_x64"
- on windows / "Windows 11 Pro" 10.0 (Build 26100)
- locale is pt-BR
Project info
- sdk constraint: '^3.7.0'
- dependencies: _fe_analyzer_shared, analysis_server_plugin, analyzer, analyzer_plugin, args, collection, convert, crypto, dart_style, dtd, http, json_rpc_2, language_server_protocol, linter, memory_usage, meta, path, pub_semver, stream_channel, telemetry, unified_analytics, vm_service, watcher, yaml, yaml_edit
- dev_dependencies: analyzer_testing, analyzer_utilities, cli_util, lints, logging, matcher, test, test_descriptor, test_reflective_loader, web_socket_channel
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 |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
in testingRelates to test execution of Dart/Flutter tests for end usersRelates to test execution of Dart/Flutter tests for end usersis bug
Activity
DanTup commentedon Sep 2, 2025
@FMorschel are you running with
RunorDebug?I made a simple sample like this:
When running with Debug, I do not get the timeout (because we suppress timeouts). But if using Run, we do (because we don't suppress it). This seems reasonable behaviour to me, but I don't know if it matches what you're seeing.
When running in debug mode, if I Capture Debugging Logs and then inspect the launch request, I see this:
This is what controls it, and it appears that test_reflective_loader is just passing the timeout through to
pkg:testand therefore it works the same.FMorschel commentedon Sep 2, 2025
Well, I do get a timeout when running on debug because I have breakpoints, and they are my problem. While running, they don't get triggered. I'll see about a screen recording later today to share with you. I can also capture debugging logs to see if that does show up.
DanTup commentedon Sep 2, 2025
If I change the delay to
Duration.zeroin the code and instead wait on a breakpoint there, I still don't see a timeout. Is this different to what you see?bp.mp4
FMorschel commentedon Sep 2, 2025
Here is a screen recording of what I see:
20250902_123228.mp4
Without any breakpoints:
But great idea to capture the logs, the
toolArgsis empty:Dart-Code-Log-2025-08-02 12-35-02.txt
DanTup commentedon Sep 2, 2025
Oh, I see the problem.. this is what I get for building isolated repros instead of testing where you did... We still have some code that considers the Dart SDK as not supporting "dart test", so we never add that arg here (which is obviously silly given that we are spawning the "dart test" debug adapter). Probably this just needs a bit of code deleting :-)
[-]Test timeouts with `test_reflective_loader`[/-][+]Timeouts are not ignored when debugging tests inside the Dart SDK[/+]FMorschel commentedon Sep 2, 2025
I didn't even try because last time I did that, the published version of
test_reflective_loaderwas still before our recent changes, so it had nothing of the behaviour I wanted to reproduce 😅.3 remaining items
Don't flag Dart SDK as disallowing "dart test"
[-]Timeouts are not ignored when debugging tests inside the Dart SDK[/-][+]Timeouts are not ignored when debugging tests inside Pub Workspaces[/+]FMorschel commentedon Oct 20, 2025
Will this be out on a pre-release version? Not necessary, but I'd be fine with testing it out before it gets to the full version and it would help me a lot on the SDK contributions. Thanks!
DanTup commentedon Oct 20, 2025
Yeah, I can do one soon - there may be a few other things worth getting in first though (for ex. the workaround for "pub get" prompts at #5760)
DanTup commentedon Oct 22, 2025
I forgot to mention, I did a pre-release yesterday :)
FMorschel commentedon Oct 22, 2025
Thanks a lot! I'll be sure to update things here.
FMorschel commentedon Oct 23, 2025
I still seem to be hitting timeouts when working on the SDK. I'm at dart-lang/sdk@1c0c66f from yesterday with
gclient syncdone.Dart-Code-Log-2025-09-04 11-48-38.txt
Workspace Environment
Output from 'dart info'
C:\Users\felip_0vh5fa6\dart\bin\dart.exe infoIf 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
Process info
DanTup commentedon Oct 23, 2025
@FMorschel can you check what this setting is set to? Edit: Apaprently GH doesn't like
vscode://settings/dart.suppressTestTimeoutslinks :-)And are you able to reload VS Code ("Reload Window" or "Restart Extension host") and then repro and grab a new log? I can't see us trying to run
dart test --versionordart test --helpin your log, but I'm not sure why.FMorschel commentedon Oct 23, 2025
Hmmm... It was on
neverby default. Is this desired behaviour? Why?Edit: Changing that to
debugdoes solve the problem. Thanks!DanTup commentedon Oct 23, 2025
Oh, I didn't notice that when I took the screenshot, thanks!
I did some digging and found:
#3687 (comment)
Looks like I never did this (before the flag was supported, we would set the timeout to 1d... maybe I didn't want to default that!).
I will use this issue to track changing the default :)
DanTup commentedon Oct 23, 2025
Oh wait, this issue was something else - I'll file a new issue for that instead 😄