Closed mkorbel1 closed 1 week ago
Summary: The dart test
command fails with a "frontend_server.dart.snapshot not found" error and a "SocketException: Write failed" error. This occurs on Ubuntu 22 LTS and Windows 11, but not on WSL2 Ubuntu on Windows 11. The issue appears to be related to the frontend_server.dart.snapshot
file and communication between processes.
This also happened on macOS when using the latest dart
binary installed by Homebrew.
Dart SDK version: 3.5.2 (stable) (Wed Aug 28 10:01:20 2024 +0000) on "macos_arm64"
This seems like a fundamental bug that for some setups dart test
does not work, and I am unaware of any workaround. I'm aware of at least 2 projects where people are severely blocked by this issue since last week.
Actually, it seems that the version of the test
package was being pinned to an older version. I noticed it after searching through forums and discord conversations that some other people hit similar issues. Checking dart pub outdated
revealed it and then I adjusted my pubspec.yaml
and fixed the issue. Leaving this note for anyone else who hits a similar problem, and closing.
Running a dart file via
dart run bin/my_file.dart
runs just fine. However, tests seem to be broken.Reproduced with Dart v3.5.1 (in an Ubuntu 22 LTS Docker container) and v3.5.2 (on Windows 11 via chocolatey) (2 separate systems). I'm not able to reproduce on WSL2 Ubuntu on Windows 11 with v3.5.1 (a third system). I'm not sure what the special conditions are to cause this error. None of these systems have Flutter installed, just Dart. All three of these are using different projects as well. Testing on all three of these projects on all three of these systems with older versions of Dart were working fine.
Hitting the
debug
button in VS Code above a test or running on the command line viadart test
causes an error like this:I noticed that the file
/usr/lib/dart/bin/snapshots/frontend_server_aot.dart.snapshot
does exist, though/usr/lib/dart/bin/snapshots/frontend_server.dart.snapshot
does not exist.Some of the output from
dart info
on the container system: