This is causing a test flake. Something causes us to check if a file is runnable via pub test before packages are restored, and this value is cached (part of #1441) we end up never re-checking.
It seems like the requirement for .packages is a bit overkill - if there's a pubspec.yaml it should be safe to assume it's valid to run tests (pub will complain if the packages are not restored).