You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
findAvailablePort in test.dart / service_worker_test.dart is a race condition and likely causes flaky tests #109474
A number of tests in service_worker_test.dart and test.dart (starting with those introduced in #82307) use a very race-prone technique for finding a port that violates our style guide.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
yjbanov commentedon Aug 12, 2022
Is this where the race is
flutter/dev/bots/utils.dart
Line 85 in dce82f7
What multiple things are racing against each other?
What would be the best way to find a free port?
Hixie commentedon Aug 12, 2022
We could be racing against anything in the OS that happens to open a port at the same time.
In general the best way to find a port is to ask the OS to allocate you one, and then use it. Often saying "port 0" is the way to do that.
mdebbar commentedon Oct 19, 2026
Fixed in #194419
github-actions commentedon Nov 2, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.