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
+
1
6
## 1.13.0
2
7
3
8
- 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 {
27
27
final SyncErrorLogger _log;
28
28
29
29
final _isolateGroups = < String , IsolateGroupState > {};
30
+ final _oldCollectionTasks = < Future <void >> {};
30
31
31
32
int _numIsolates = 0 ;
32
33
bool _finishedListening = false ;
@@ -48,7 +49,7 @@ class IsolatePausedListener {
48
49
_finishedListening = true ;
49
50
50
51
// Collect all remaining uncollected groups.
51
- final collectionTasks = < Future < void > > [] ;
52
+ final collectionTasks = _oldCollectionTasks. toList () ;
52
53
for (final group in _isolateGroups.values) {
53
54
if (! group.collected) {
54
55
group.collected = true ;
@@ -91,9 +92,13 @@ class IsolatePausedListener {
91
92
if (isLastIsolateInGroup) {
92
93
group.collected = true ;
93
94
}
95
+ Future <void >? collectionTask;
94
96
try {
95
- await _onIsolatePaused (isolateRef, isLastIsolateInGroup);
97
+ collectionTask = _onIsolatePaused (isolateRef, isLastIsolateInGroup);
98
+ _oldCollectionTasks.add (collectionTask);
99
+ await collectionTask;
96
100
} finally {
101
+ _oldCollectionTasks.remove (collectionTask);
97
102
group.exit (isolateRef);
98
103
if (! _finishedListening) {
99
104
await _service.resume (isolateRef.id! );
Original file line number Diff line number Diff line change 1
1
name : coverage
2
- version : 1.13.0
2
+ version : 1.13.1
3
3
description : Coverage data manipulation and formatting
4
4
repository : https://github.com/dart-lang/tools/tree/main/pkgs/coverage
5
5
issue_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() {
867
867
pauseEvent ('B' , '2' );
868
868
pauseEvent ('A' , '1' , 'main' );
869
869
870
- while (received.length < 4 ) {
870
+ while (received.length < 3 ) {
871
871
await Future <void >.delayed (Duration .zero);
872
872
}
873
873
874
874
expect (received, [
875
875
'Pause B. Collect group 2? Yes' ,
876
876
'Pause A. Collect group 1? Yes' ,
877
877
'Pause done A' ,
878
- 'Resume A' ,
879
878
]);
880
879
881
880
delayingB.complete ();
@@ -884,8 +883,9 @@ void main() {
884
883
'Pause B. Collect group 2? Yes' ,
885
884
'Pause A. Collect group 1? Yes' ,
886
885
'Pause done A' ,
887
- 'Resume A' ,
888
886
'Pause done B' ,
887
+ // A waits for B's pause callback to complete before resuming.
888
+ 'Resume A' ,
889
889
// Don't try to resume B, because the VM service is already shut down.
890
890
]);
891
891
});
You can’t perform that action at this time.
0 commit comments