Discussion:
[dart-misc] Getting coverage to work when tests spawn isolates
Don Olmstead
2016-01-12 22:07:39 UTC
Permalink
I have a library that I'm attempting to use the coverage package with. This
library does code generation so I've been running tests on the generated
code in an isolate to make sure that the generated code is functioning
properly. I can run the tests using the following

dart --observe=8000 test\all.dart

And get coverage using

pub global run coverage:collect_coverage --port=8000 -o coverage.json --
resume-isolates

In this configuration however I get the following error from that command.

JsonRpcError: VM must be paused (101)
dart:async _Completer.completeError
package:coverage/src/devtools.dart 227 _Connection._handleResponse
===== asynchronous gap ===========================
dart:io _WebSocketImpl.listen
package:coverage/src/devtools.dart 184 _Connection._Connection
package:coverage/src/devtools.dart 191 _Connection.connect.<async>
===== asynchronous gap ===========================
dart:async _asyncThenWrapperHelper
package:coverage/src/devtools.dart _Connection.connect
package:coverage/src/devtools.dart 93 VMService.
connectToVMWebsocket.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:coverage/src/devtools.dart VMService.
connectToVMWebsocket
package:coverage/src/devtools.dart 89 VMService.connect.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:coverage/src/devtools.dart VMService.connect
package:coverage/src/collect.dart 17 collect.<async>.<fn>
package:coverage/src/util.dart 38 retry.<async>.<fn>.<async>
===== asynchronous gap ===========================
package:coverage retry.<async>.<fn>
package:coverage/src/util.dart 17 retry.<async>._withTimeout
package:coverage/src/util.dart 35 retry.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:coverage/src/util.dart retry
package:coverage/src/collect.dart 16 collect.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:coverage/src/collect.dart collect
http://localhost:50032/collect_coverage.dart 21 main.<async>.<fn>.<async>
===== asynchronous gap ===========================
package:stack_trace Chain.capture
http://localhost:50032/collect_coverage.dart 20 main.<async>

If I keep running the command eventually, three times total, a coverage
report gets generated. Not entirely sure if everything's there for it but
I'm able to take it and turn it into LCOV format.

Anyways I'm not sure if I should be running the root tests in a special way
to handle this case. Any ideas? On Winders if it matters any.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Kevin Moore
2016-01-13 01:19:01 UTC
Permalink
The usual questions:

version of coverage package?
version of Dart SDK?

Also:

Have you created a minimal repo (test/all.dart with a trivial main)? Same
behavior?

Are you using pkg/test?
Post by Don Olmstead
I have a library that I'm attempting to use the coverage package with.
This library does code generation so I've been running tests on the
generated code in an isolate to make sure that the generated code is
functioning properly. I can run the tests using the following
dart --observe=8000 test\all.dart
And get coverage using
pub global run coverage:collect_coverage --port=8000 -o coverage.json --
resume-isolates
In this configuration however I get the following error from that command.
JsonRpcError: VM must be paused (101)
dart:async _Completer.completeError
package:coverage/src/devtools.dart 227 _Connection.
_handleResponse
===== asynchronous gap ===========================
dart:io _WebSocketImpl.listen
package:coverage/src/devtools.dart 184 _Connection._Connection
package:coverage/src/devtools.dart 191 _Connection.connect.<
async>
===== asynchronous gap ===========================
dart:async _asyncThenWrapperHelper
package:coverage/src/devtools.dart _Connection.connect
package:coverage/src/devtools.dart 93 VMService.
connectToVMWebsocket.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:coverage/src/devtools.dart VMService.
connectToVMWebsocket
package:coverage/src/devtools.dart 89 VMService.connect.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:coverage/src/devtools.dart VMService.connect
package:coverage/src/collect.dart 17 collect.<async>.<fn>
package:coverage/src/util.dart 38 retry.<async>.<fn>.<async
===== asynchronous gap ===========================
package:coverage retry.<async>.<fn>
package:coverage/src/util.dart 17 retry.<async>.
_withTimeout
package:coverage/src/util.dart 35 retry.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:coverage/src/util.dart retry
package:coverage/src/collect.dart 16 collect.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:coverage/src/collect.dart collect
http://localhost:50032/collect_coverage.dart 21 main.<async>.<fn>.<async>
===== asynchronous gap ===========================
package:stack_trace Chain.capture
http://localhost:50032/collect_coverage.dart 20 main.<async>
If I keep running the command eventually, three times total, a coverage
report gets generated. Not entirely sure if everything's there for it but
I'm able to take it and turn it into LCOV format.
Anyways I'm not sure if I should be running the root tests in a special
way to handle this case. Any ideas? On Winders if it matters any.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Don Olmstead
2016-01-13 01:50:13 UTC
Permalink
Sorry it was less of a bug report and more a question of whether I'm doing
something wrong there. The setup works fine as long as I'm not spawning
isolates.

sdk 1.14.0-dev.6.0
coverage 0.7.2

Not using test as I didn't think it was actually working with coverage
reports.

I can open an issue I just wasn't sure if it was a bug and if so who would
be the one to assign it to coverage or the sdk.
Post by Kevin Moore
version of coverage package?
version of Dart SDK?
Have you created a minimal repo (test/all.dart with a trivial main)? Same
behavior?
Are you using pkg/test?
Post by Don Olmstead
I have a library that I'm attempting to use the coverage package with.
This library does code generation so I've been running tests on the
generated code in an isolate to make sure that the generated code is
functioning properly. I can run the tests using the following
dart --observe=8000 test\all.dart
And get coverage using
pub global run coverage:collect_coverage --port=8000 -o coverage.json --
resume-isolates
In this configuration however I get the following error from that command.
JsonRpcError: VM must be paused (101)
dart:async _Completer.completeError
package:coverage/src/devtools.dart 227 _Connection.
_handleResponse
===== asynchronous gap ===========================
dart:io _WebSocketImpl.listen
package:coverage/src/devtools.dart 184 _Connection._Connection
package:coverage/src/devtools.dart 191 _Connection.connect.<
async>
===== asynchronous gap ===========================
dart:async _asyncThenWrapperHelper
package:coverage/src/devtools.dart _Connection.connect
package:coverage/src/devtools.dart 93 VMService.
connectToVMWebsocket.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:coverage/src/devtools.dart VMService.
connectToVMWebsocket
package:coverage/src/devtools.dart 89 VMService.connect.<async
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:coverage/src/devtools.dart VMService.connect
package:coverage/src/collect.dart 17 collect.<async>.<fn>
package:coverage/src/util.dart 38 retry.<async>.<fn>.<
async>
===== asynchronous gap ===========================
package:coverage retry.<async>.<fn>
package:coverage/src/util.dart 17 retry.<async>.
_withTimeout
package:coverage/src/util.dart 35 retry.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:coverage/src/util.dart retry
package:coverage/src/collect.dart 16 collect.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:coverage/src/collect.dart collect
http://localhost:50032/collect_coverage.dart 21
main.<async>.<fn>.<async>
===== asynchronous gap ===========================
package:stack_trace Chain.capture
http://localhost:50032/collect_coverage.dart 20 main.<async>
If I keep running the command eventually, three times total, a coverage
report gets generated. Not entirely sure if everything's there for it but
I'm able to take it and turn it into LCOV format.
Anyways I'm not sure if I should be running the root tests in a special
way to handle this case. Any ideas? On Winders if it matters any.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Don Olmstead
2016-01-13 01:57:20 UTC
Permalink
https://github.com/dogma-dart/dogma-codegen-test has some pretty
straightforward tests with it. It is having the same sorts of issues but
worse as there are more isolate tests.
Post by Don Olmstead
Sorry it was less of a bug report and more a question of whether I'm doing
something wrong there. The setup works fine as long as I'm not spawning
isolates.
sdk 1.14.0-dev.6.0
coverage 0.7.2
Not using test as I didn't think it was actually working with coverage
reports.
I can open an issue I just wasn't sure if it was a bug and if so who would
be the one to assign it to coverage or the sdk.
Post by Kevin Moore
version of coverage package?
version of Dart SDK?
Have you created a minimal repo (test/all.dart with a trivial main)? Same
behavior?
Are you using pkg/test?
Post by Don Olmstead
I have a library that I'm attempting to use the coverage package with.
This library does code generation so I've been running tests on the
generated code in an isolate to make sure that the generated code is
functioning properly. I can run the tests using the following
dart --observe=8000 test\all.dart
And get coverage using
pub global run coverage:collect_coverage --port=8000 -o coverage.json --
resume-isolates
In this configuration however I get the following error from that command.
JsonRpcError: VM must be paused (101)
dart:async _Completer.
completeError
package:coverage/src/devtools.dart 227 _Connection.
_handleResponse
===== asynchronous gap ===========================
dart:io _WebSocketImpl.listen
package:coverage/src/devtools.dart 184 _Connection._Connection
package:coverage/src/devtools.dart 191 _Connection.connect.<
async>
===== asynchronous gap ===========================
dart:async _asyncThenWrapperHelper
package:coverage/src/devtools.dart _Connection.connect
package:coverage/src/devtools.dart 93 VMService.
connectToVMWebsocket.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:coverage/src/devtools.dart VMService.
connectToVMWebsocket
package:coverage/src/devtools.dart 89 VMService.connect.<
async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:coverage/src/devtools.dart VMService.connect
package:coverage/src/collect.dart 17 collect.<async>.<fn>
package:coverage/src/util.dart 38 retry.<async>.<fn>.<
async>
===== asynchronous gap ===========================
package:coverage retry.<async>.<fn>
package:coverage/src/util.dart 17 retry.<async>.
_withTimeout
package:coverage/src/util.dart 35 retry.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:coverage/src/util.dart retry
package:coverage/src/collect.dart 16 collect.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:coverage/src/collect.dart collect
http://localhost:50032/collect_coverage.dart 21
main.<async>.<fn>.<async>
===== asynchronous gap ===========================
package:stack_trace Chain.capture
http://localhost:50032/collect_coverage.dart 20 main.<async>
If I keep running the command eventually, three times total, a coverage
report gets generated. Not entirely sure if everything's there for it but
I'm able to take it and turn it into LCOV format.
Anyways I'm not sure if I should be running the root tests in a special
way to handle this case. Any ideas? On Winders if it matters any.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Don Olmstead
2016-01-13 18:05:19 UTC
Permalink
https://github.com/dart-lang/coverage/issues/101
Post by Don Olmstead
https://github.com/dogma-dart/dogma-codegen-test has some pretty
straightforward tests with it. It is having the same sorts of issues but
worse as there are more isolate tests.
Post by Don Olmstead
Sorry it was less of a bug report and more a question of whether I'm
doing something wrong there. The setup works fine as long as I'm not
spawning isolates.
sdk 1.14.0-dev.6.0
coverage 0.7.2
Not using test as I didn't think it was actually working with coverage
reports.
I can open an issue I just wasn't sure if it was a bug and if so who
would be the one to assign it to coverage or the sdk.
Post by Kevin Moore
version of coverage package?
version of Dart SDK?
Have you created a minimal repo (test/all.dart with a trivial main)?
Same behavior?
Are you using pkg/test?
Post by Don Olmstead
I have a library that I'm attempting to use the coverage package with.
This library does code generation so I've been running tests on the
generated code in an isolate to make sure that the generated code is
functioning properly. I can run the tests using the following
dart --observe=8000 test\all.dart
And get coverage using
pub global run coverage:collect_coverage --port=8000 -o coverage.json
--resume-isolates
In this configuration however I get the following error from that command.
JsonRpcError: VM must be paused (101)
dart:async _Completer.
completeError
package:coverage/src/devtools.dart 227 _Connection.
_handleResponse
===== asynchronous gap ===========================
dart:io _WebSocketImpl.listen
package:coverage/src/devtools.dart 184 _Connection.
_Connection
package:coverage/src/devtools.dart 191 _Connection.connect.<
async>
===== asynchronous gap ===========================
dart:async
_asyncThenWrapperHelper
package:coverage/src/devtools.dart _Connection.connect
package:coverage/src/devtools.dart 93 VMService.
connectToVMWebsocket.<async>
===== asynchronous gap ===========================
dart:async Future.Future.
microtask
package:coverage/src/devtools.dart VMService.
connectToVMWebsocket
package:coverage/src/devtools.dart 89 VMService.connect.<
async>
===== asynchronous gap ===========================
dart:async Future.Future.
microtask
package:coverage/src/devtools.dart VMService.connect
package:coverage/src/collect.dart 17 collect.<async>.<fn>
package:coverage/src/util.dart 38 retry.<async>.<fn>.<
async>
===== asynchronous gap ===========================
package:coverage retry.<async>.<fn>
package:coverage/src/util.dart 17 retry.<async>.
_withTimeout
package:coverage/src/util.dart 35 retry.<async>
===== asynchronous gap ===========================
dart:async Future.Future.
microtask
package:coverage/src/util.dart retry
package:coverage/src/collect.dart 16 collect.<async>
===== asynchronous gap ===========================
dart:async Future.Future.
microtask
package:coverage/src/collect.dart collect
http://localhost:50032/collect_coverage.dart 21
main.<async>.<fn>.<async>
===== asynchronous gap ===========================
package:stack_trace Chain.capture
http://localhost:50032/collect_coverage.dart 20 main.<async>
If I keep running the command eventually, three times total, a coverage
report gets generated. Not entirely sure if everything's there for it but
I'm able to take it and turn it into LCOV format.
Anyways I'm not sure if I should be running the root tests in a special
way to handle this case. Any ideas? On Winders if it matters any.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to
http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Loading...