dart-lang / dart-lang/test

Tests don't finish "loading" until main returns - obfuscating the actual issue

Open
#892 2 comments 0 reactions 0 assignees View on GitHub
type-bug
Dominant language
Dart
Stars
536
Forks
232
Avg merge
1d 10h
Merged PRs (30d)
10

Description

The "loading" message is displayed until the "main" function of the test returns, and if it returns a Future then it waits until that Future completes.

If for some reason the test returns a Future that never completes then it will hang on the "loading" phase indefinitely. Timeouts are not respected. This makes it appear like a bug in the test runner and not the test itself.

For instance the following test will wait the full 90 seconds on the "loading" phase:

```
main() async {
await Future.delayed(Duration(seconds: 90));
}
```

I think it makes sense that we consider this the "loading" phase, as we are still collecting groups/tests, but we should at least respect the timeouts during the phase.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the provided async main and a timeout, then trace how the test runner waits for main to return during the loading phase. Done means a test whose Future never completes no longer masks the failure indefinitely and configured timeouts are respected during loading.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.