Remove race conditions involving finding available ports (#18698)
This is an attempt to reland #18488 with less breakage on macOS.
This commit is contained in:
@@ -35,12 +35,14 @@ void main() {
|
||||
.listen((String line) {
|
||||
print('run:stdout: $line');
|
||||
stdout.add(line);
|
||||
if (lineContainsServicePort(line)) {
|
||||
if (vmServicePort == null) {
|
||||
vmServicePort = parseServicePort(line);
|
||||
print('service protocol connection available at port $vmServicePort');
|
||||
print('run: ready!');
|
||||
ready.complete();
|
||||
ok ??= true;
|
||||
if (vmServicePort != null) {
|
||||
print('service protocol connection available at port $vmServicePort');
|
||||
print('run: ready!');
|
||||
ready.complete();
|
||||
ok ??= true;
|
||||
}
|
||||
}
|
||||
});
|
||||
run.stderr
|
||||
|
||||
@@ -41,12 +41,14 @@ void main() {
|
||||
.transform(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('run:stdout: $line');
|
||||
if (lineContainsServicePort(line)) {
|
||||
if (vmServicePort == null) {
|
||||
vmServicePort = parseServicePort(line);
|
||||
print('service protocol connection available at port $vmServicePort');
|
||||
print('run: ready!');
|
||||
ready.complete();
|
||||
ok ??= true;
|
||||
if (vmServicePort != null) {
|
||||
print('service protocol connection available at port $vmServicePort');
|
||||
print('run: ready!');
|
||||
ready.complete();
|
||||
ok ??= true;
|
||||
}
|
||||
}
|
||||
});
|
||||
run.stderr
|
||||
|
||||
@@ -33,12 +33,14 @@ void main() {
|
||||
.transform(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('run:stdout: $line');
|
||||
if (lineContainsServicePort(line)) {
|
||||
if (vmServicePort == null) {
|
||||
vmServicePort = parseServicePort(line);
|
||||
print('service protocol connection available at port $vmServicePort');
|
||||
print('run: ready!');
|
||||
ready.complete();
|
||||
ok ??= true;
|
||||
if (vmServicePort != null) {
|
||||
print('service protocol connection available at port $vmServicePort');
|
||||
print('run: ready!');
|
||||
ready.complete();
|
||||
ok ??= true;
|
||||
}
|
||||
}
|
||||
});
|
||||
run.stderr
|
||||
|
||||
Reference in New Issue
Block a user