File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 1+ ## 1.13.1
2+
3+ - Fix a bug where the VM service can be shut down while some coverage
4+ collections are still happening.
5+
16## 1.13.0
27
38- Introduced support for minimum coverage thresholds using --fail-under flag in
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ class IsolatePausedListener {
2727 final SyncErrorLogger _log;
2828
2929 final _isolateGroups = < String , IsolateGroupState > {};
30+ final _oldCollectionTasks = < Future <void >> {};
3031
3132 int _numIsolates = 0 ;
3233 bool _finishedListening = false ;
@@ -48,7 +49,7 @@ class IsolatePausedListener {
4849 _finishedListening = true ;
4950
5051 // Collect all remaining uncollected groups.
51- final collectionTasks = < Future < void > > [] ;
52+ final collectionTasks = _oldCollectionTasks. toList () ;
5253 for (final group in _isolateGroups.values) {
5354 if (! group.collected) {
5455 group.collected = true ;
@@ -91,9 +92,13 @@ class IsolatePausedListener {
9192 if (isLastIsolateInGroup) {
9293 group.collected = true ;
9394 }
95+ Future <void >? collectionTask;
9496 try {
95- await _onIsolatePaused (isolateRef, isLastIsolateInGroup);
97+ collectionTask = _onIsolatePaused (isolateRef, isLastIsolateInGroup);
98+ _oldCollectionTasks.add (collectionTask);
99+ await collectionTask;
96100 } finally {
101+ _oldCollectionTasks.remove (collectionTask);
97102 group.exit (isolateRef);
98103 if (! _finishedListening) {
99104 await _service.resume (isolateRef.id! );
Original file line number Diff line number Diff line change 11name : coverage
2- version : 1.13.0
2+ version : 1.13.1
33description : Coverage data manipulation and formatting
44repository : https://github.com/dart-lang/tools/tree/main/pkgs/coverage
55issue_tracker : https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Acoverage
Original file line number Diff line number Diff line change @@ -867,15 +867,14 @@ void main() {
867867 pauseEvent ('B' , '2' );
868868 pauseEvent ('A' , '1' , 'main' );
869869
870- while (received.length < 4 ) {
870+ while (received.length < 3 ) {
871871 await Future <void >.delayed (Duration .zero);
872872 }
873873
874874 expect (received, [
875875 'Pause B. Collect group 2? Yes' ,
876876 'Pause A. Collect group 1? Yes' ,
877877 'Pause done A' ,
878- 'Resume A' ,
879878 ]);
880879
881880 delayingB.complete ();
@@ -884,8 +883,9 @@ void main() {
884883 'Pause B. Collect group 2? Yes' ,
885884 'Pause A. Collect group 1? Yes' ,
886885 'Pause done A' ,
887- 'Resume A' ,
888886 'Pause done B' ,
887+ // A waits for B's pause callback to complete before resuming.
888+ 'Resume A' ,
889889 // Don't try to resume B, because the VM service is already shut down.
890890 ]);
891891 });
You can’t perform that action at this time.
0 commit comments