Closed
Description
This may need to be split into separate issues, but while I still have the context in my head I want to write this out.
See also #51382
Tests in the ingtegration.shard
folder tend to have the following structure:
- Launch Flutter via the shell script entrypoint (
flutter.bat
orflutter
depending on the OS). - This might be done multiple times, e.g. to create a project in a temp dir, and then to launch
flutter test --start-paused
. - This causes Flutter to spawn a Dart VM process that is told to never terminate.
- The test tries to clean things up by connecting to the VM, getting its PID, and eventually killing the process
- killPid in Dart does not guarantee process death, and does not wait for the process to terminate
- Killing the shell script invocation does not necessarily kill the launched flutter_tester process, or, if it does, it takes longer than the termination of the shell script itself.
- The test attempts to delete temporary files, and swallows exceptions. A comment in the source indicates we believe this to be a permissions issue, where in reality it's that we spawned a process that hasn't terminated that is holding an exclusive lock on the files (on Windows).
I attempted to deflake some of this in the linked PR, but my attempts are still flakey because we don't have a handle on the Process to be able to actually wait for it to exit.
We could potentially refactor these tests to not use the flutter
/flutter.bat
entrypoints so that we can properly control process death. We should also investigate whether flutter test --start-paused
leaks processes on Windows.
Metadata
Metadata
Assignees
Labels
Important issues not at the top of the work list"flutter test", flutter_test, or one of our testsTeam-specific productivity, code health, technical debt.Tests that sometimes, but not always, incorrectly passOwned by Flutter Tool teamAffects the "flutter" command-line tool. See also t: labels.Triaged by Flutter Tool team