#!/usr/bin/env bash
pub global run coverage:collect_coverage --port=8111 --out=coverage/coverage.json --resume-isolates --wait-paused &
dart --observe=8111 test/all.dart
pub global run coverage:format_coverage --packages=.packages --in=coverage/coverage.json --lcov --report-on=lib --out=coverage/lcov.info
With Dart 1.24.2, 1.25.0-dev.16.4 and
Dart VM version: 2.0.0-dev.8.0 (Fri Nov 17 13:56:30 2017) on "macos_x64"
(add_tests) $ tool/codecov.sh
Observatory server failed to start after 1 tries
00:00 +0: onInitializedChange should emit true when initialized
00:00 +1: onInitializationCompleted should complete when initialized
00:00 +2: change theme should update state and emit onThemeChange
00:00 +3: change active screen should update state
00:00 +4: change active tab should update state
00:00 +5: changing active screen should clear active tab
00:00 +6: invoking changeActiveScreen action with the name of the current screen, should not clear active tab
00:00 +7: changing database should update state
00:00 +8: onStateChange should emit an event when state changes
00:00 +9: getUserProfile should cause the user profile to get loaded
00:00 +10: actions.group.groupsChanged action should change group
00:00 +11: actions.group.groupsChanged with group of owner should auto-select the group
00:00 +12: GroupMessageComposeController initial state should be defined
00:00 +13: GroupMessageComposeController createNewMessage action should update state
00:00 +14: GroupMessageComposeController loaded message should update messages and messageEvent
00:00 +15: GroupMessageListController timeago should format seconds ago
00:00 +16: GroupMessageController (2) should create controllers for subsequently added messages
00:00 +17: JSON (de)serialization serialize - deserialize should result in the original value
00:00 +18: JSON (de)serialization deserialization should handle string dates correctly
00:00 +19: JSON (de)serialization deserialization should handle Uri correctly
00:00 +20: JSON (de)serialization serialize and deserialize should succeed for BabyProfile
00:00 +21: JSON (de)serialization serialize and deserialize should succeed for Group
00:00 +22: JSON (de)serialization serialize and deserialize should succeed for GroupBookEntry
00:00 +23: app reducer wasInitialized
00:00 +24: app reducer databaseChanged
00:00 +25: app reducer popupMessageAdded
00:00 +26: app reducer popupMessageCleared
00:00 +27: app reducer popupMessageRemoved
00:00 +28: app reducer themeChanged
00:00 +29: app reducer userProfileChanged
00:00 +30: app reducer ticked
00:00 +31: authentication reducer authenticatedUserChanged
00:00 +32: authentication reducer loggedInWithGoogle
00:00 +33: authentication reducer loggedOut
00:00 +34: database simple request should succeed
00:00 +35: database request should fail
00:00 +36: should generate log record
00:00 +37: log record should not print security sensitive information
00:00 +38: All tests passed!
vm-service: isolate(737052896) 'all.dart:main()' has no debugger attached and is paused at exit. Connect to Observatory to debug.
Observatory server failed to start after 2 tries
Observatory server failed to start after 3 tries
Observatory server failed to start after 4 tries
Observatory server failed to start after 5 tries
Observatory server failed to start after 6 tries
Observatory server failed to start after 7 tries
Observatory server failed to start after 8 tries
Observatory server failed to start after 9 tries
Observatory server failed to start after 10 tries
Observatory server failed to start after 11 tries
Could not start Observatory HTTP server:
SocketException: Failed to create server socket (OS Error: Address already in use, errno = 48), address = localhost, port = 8111
#0 _NativeSocket.bind (dart:io-patch/socket_patch.dart:542)
<asynchronous suspension>
#1 _RawServerSocket.bind (dart:io-patch/socket_patch.dart:1124)
#2 _ServerSocket.bind (dart:io-patch/socket_patch.dart:1371)
#3 ServerSocket.bind (dart:io-patch/socket_patch.dart:1361)
#4 _HttpServer.bind (dart:_http/http_impl.dart:2500)
#5 HttpServer.bind (dart:_http:276)
#6 Server.startup.poll (server.dart:348:36)
<asynchronous suspension>
#7 Server.startup (server.dart:360:23)
<asynchronous suspension>
#8 main (dart:vmservice_io:239:12)
^C
This worked until a few hours ago, therfore looks like an issue on my site,
but I first saw it fail on Travis. Also reverting code changes doesn't make it work again.
Any idea?
That seems to be working again.
No idea what caused it to fail and what made it work again.
It started again recently
Dart VM version: 2.0.0-dev.20.0 (Mon Jan 29 16:25:01 2018 +0100) on "macos_x64"
With
#!/usr/bin/env bash
pub global run coverage:collect_coverage --out=coverage/coverage.json --resume-isolates --wait-paused &
dart --observe test/all.dart
pub global run coverage:format_coverage --packages=.packages --in=coverage/coverage.json --lcov --report-on=lib --out=coverage/lcov.info
the error goes away but coverage doesn't seem to wait for all async code to complete.
This way the 2nd last (of ~200 tests) fails but it works fine when I run the tests without coverage.
same with
dart --pause-isolates-on-exit --enable-vm-service=8111 test/all.dart
pub global run coverage:collect_coverage --uri=http://localhost:8111 -o coverage/coverage.json --resume-isolates
which is more aligned with the docs (https://github.com/dart-lang/coverage/blob/master/README.md)
The error "Observatory server failed to start after" is gone again, but coverage still doesn't seem to wait for async code to complete :-/
It somehow looks like "Observatory server failed to start after" occurs when there is still a previous runs listening, but I checked several times that the port is not used.
Now I only get the error if a previous run still hangs in the background.
Update
That was my mistake. A delayed action accessed a property null.
So is there a known fix? I always get this error when running pure dart projects.
/usr/local/opt/dart/libexec/bin/dart --enable-asserts --enable-vm-service:63603 /Users/thinkdigital/IdeaProjects/isolates_example/bin/main.dart
Could not start Observatory HTTP server:
SocketException: Failed host lookup: 'localhost' (OS Error: nodename nor servname provided, or not known, errno = 8)
#0 _NativeSocket.lookup.<anonymous closure> (dart:io-patch/socket_patch.dart:356)
#1 _RootZone.runUnary (dart:async/zone.dart:1381)
#2 _FutureListener.handleValue (dart:async/future_impl.dart:129)
#3 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:638)
#4 Future._propagateToListeners (dart:async/future_impl.dart:667)
#5 Future._completeWithValue (dart:async/future_impl.dart:482)
#6 Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:512)
#7 _microtaskLoop (dart:async/schedule_microtask.dart:41)
#8 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#9 _runPendingImmediateCallback (dart:isolate-patch/dart:isolate/isolate_patch.dart:113)
#10 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:166)
I wasn't able to make this reliably reproducible.
Restarting your computer will probably fix it until you run into it again eventually.
I've gotten this since I started in March. With every flutter and dart update that comes with it
Update. Still getting it. Trying to run unit tests in my flutter app.
pubspec.yaml:
dev_dependencies:
flutter_test:
sdk: flutter
student_test.dart
import 'package:test/test.dart';
import 'package:teddycare/src/shared/models/models.dart';
import 'package:teddycare/src/firebase_utils.dart';
void main(List<String> arguments) {
group("Student data test", () async {
var studentDocumentReference =
firestore.collection("students").document("-LXtlghYpPyJwHn9QVfx");
var studentDocument = await studentDocumentReference.get();
Student testStudent = Student.fromDocument(studentDocument);
var testStudentJson = testStudent.toJson();
test("Name should be present", () {
print(mapEquality(testStudentJson, studentDocument.data));
expect(testStudentJson, studentDocument.data);
});
});
}
error:
Observatory server failed to start after 1 tries
Observatory server failed to start after 2 tries
file:///Users/thinkdigital/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.8.2+3/lib/cloud_firestore.dart:10:8: Error: Not found: 'dart:ui'
import 'dart:ui' show hashValues, hashList;
^
file:///Users/thinkdigital/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.5+1/lib/firebase_core.dart:9:8: Error: Not found: 'dart:ui'
import 'dart:ui' show hashValues;
^
file:///Users/thinkdigital/development/flutter/packages/flutter/lib/src/foundation/basic_types.dart:10:1: Error: Not found: 'dart:ui'
export 'dart:ui' show VoidCallback;
^
file:///Users/thinkdigital/development/flutter/packages/flutter/lib/src/foundation/binding.dart:10:8: Error: Not found: 'dart:ui'
import 'dart:ui' as ui show saveCompilationTrace, Window, window;
^
file:///Users/thinkdigital/development/flutter/packages/flutter/lib/src/foundation/key.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show hashValues;
^
file:///Users/thinkdigital/development/flutter/packages/flutter/lib/src/foundation/profile.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show VoidCallback;
^
file:///Users/thinkdigital/development/flutter/packages/flutter/lib/src/services/font_loader.dart:7:8: Error: Not found: 'dart:ui'
import 'dart:ui';
^
file:///Users/thinkdigital/development/flutter/packages/flutter/lib/src/services/platform_messages.dart:7:8: Error: Not found: 'dart:ui'
import 'dart:ui' as ui;
^
file:///Users/thinkdigital/development/flutter/packages/flutter/lib/src/services/platform_views.dart:7:8: Error: Not found: 'dart:ui'
import 'dart:ui';
^
file:///Users/thinkdigital/development/flutter/packages/flutter/lib/src/services/system_channels.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui';
^
I'm fully up-to-date with Flutter and Dart SDK versions. I get this all the time from both VS Code and Android Studio, trying to debug tests. No amount of reboots are helping. I have based my Flutter app on the inKino project and I'm trying it in the pure Dart core folder of this project.
I'm not sure if I'm just making some noob mistake or it is related to this thread.
`Observatory server failed to start after 11 tries
Could not start Observatory HTTP server:
SocketException: Failed host lookup: 'localhost' (OS Error: nodename nor servname provided, or not known, errno = 8)
`
@jadusty , I put this to AndroidManifest.xml and it works fine for me. <uses-permission android:name="android.permission.INTERNET"/>
@jadusty Your dart:ui issue might be related to this: https://github.com/flutter/flutter/issues/27826
I get this all the time with pure Dart projects in the IDE tests or no
tests. And debugging simply doesn't work at all
On Tue, Jun 11, 2019, 6:27 AM Steven Spiel notifications@github.com wrote:
@jadusty https://github.com/jadusty Your dart:ui issue might be related
to this: flutter/flutter#27826
https://github.com/flutter/flutter/issues/27826—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/dart-lang/sdk/issues/31532?email_source=notifications&email_token=AFPYO7INS3PHIMZK5S5HJWLPZ6R4HA5CNFSM4EGVAXU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXNDPPA#issuecomment-500840380,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFPYO7NJWYPLTLSROYLPX5DPZ6R4HANCNFSM4EGVAXUQ
.
A fluke happened! I got it to work for a few hours today! I left the debugger paused while I did some other stuff and when I finally went back to restart the tests, I started getting this error again. (-_-) fun over. Any way I can help get to the root of this? I even reverted my code to it's previous state to make sure it wasn't a bad import and nothing. no dart:ui, no mention of any flutter code.
My Error:
SocketException: Failed host lookup: 'localhost' (OS Error: nodename nor servname provided, or not known, errno = 8)
I have this problem too:
Observatory server failed to start after 1 tries
Observatory server failed to start after 2 tries
Observatory server failed to start after 3 tries
Observatory server failed to start after 4 tries
00:00 +0: AllLocales Tests returns AllLocales from json string
00:00 +1: Asset Tests returns Asset from json string
00:00 +2: Locale Tests returns Locale from json string
00:00 +3: Space Tests returns Space from json string
00:00 +4: SystemFields returns SystemFields from json string
00:00 +5: All tests passed!
Observatory server failed to start after 5 tries
Observatory server failed to start after 6 tries
Observatory server failed to start after 7 tries
Observatory server failed to start after 8 tries
Observatory server failed to start after 9 tries
Observatory server failed to start after 10 tries
Observatory server failed to start after 11 tries
Could not start Observatory HTTP server:
SocketException: Failed to create server socket (OS Error: Address already in use, errno = 48), address = localhost, port = 8111
#0 _NativeSocket.bind (dart:io-patch/socket_patch.dart:603:7)
<asynchronous suspension>
#1 _RawServerSocket.bind (dart:io-patch/socket_patch.dart:1218:26)
#2 _ServerSocket.bind (dart:io-patch/socket_patch.dart:1478:29)
#3 ServerSocket.bind (dart:io-patch/socket_patch.dart:1469:26)
#4 _HttpServer.bind (dart:_http/http_impl.dart:2534:25)
#5 HttpServer.bind (dart:_http:227:19)
#6 Server.startup.poll (dart:vmservice_io/server.dart:385:36)
<asynchronous suspension>
#7 Server.startup (dart:vmservice_io/server.dart:397:23)
<asynchronous suspension>
#8 main (dart:vmservice_io:257:12)
How to kill server on a port?
@jadusty , I put this to AndroidManifest.xml and it works fine for me.
<uses-permission android:name="android.permission.INTERNET"/>
That's work for me
I solved the same problem after a long time. It is not just the INTERNET permission in AndroidManifest.xml. In my case, I received the same error, but I noticed that my project did not have the debug folder inside app> src.
I needed to create this folder manually and insert the file AndroidManifest.xml. With the code below:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your_app_package_name">
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
@jadusty , I put this to AndroidManifest.xml and it works fine for me.
<uses-permission android:name="android.permission.INTERNET"/>
the code should be below the
or
outside of
@ShadowDeveloper Thanks for this reply man, that worked for me!
@BuddhaNag12 The code have to be inside the manifest tag exclusively.
Most helpful comment
I solved the same problem after a long time. It is not just the INTERNET permission in AndroidManifest.xml. In my case, I received the same error, but I noticed that my project did not have the debug folder inside app> src.
I needed to create this folder manually and insert the file AndroidManifest.xml. With the code below: