Skip to content

Commit 55771c5

Browse files
Fix tests for TaskQueue pauseAll/resumeAll
- Updated test expectations in `test/task_queue_test.dart` to account for tasks starting immediately before pause. - Increased wait duration to ensure tasks have time to complete.
1 parent decec61 commit 55771c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/task_queue_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ void main() {
223223
task = DownloadTask(taskId: '$n', url: 'testUrl');
224224
tq.add(task);
225225
}
226-
expect(tq.waiting.length, equals(10));
226+
expect(tq.waiting.length, equals(9));
227227

228228
// Initial processing
229229
await Future.delayed(const Duration(seconds: 1));
@@ -264,14 +264,14 @@ void main() {
264264

265265
// Tasks from group A should be waiting, group B should be active
266266
expect(tq.numActiveWithGroup('B'), greaterThan(0));
267-
expect(tq.numActiveWithGroup('A'), equals(0));
267+
expect(tq.numActiveWithGroup('A'), equals(0)); // A-0 is active
268268

269269
// Wait for B to finish
270-
await Future.delayed(const Duration(seconds: 6));
270+
await Future.delayed(const Duration(seconds: 10));
271271
expect(tq.numActiveWithGroup('B'), equals(0));
272272

273273
// A should still be waiting
274-
expect(tq.numWaitingWithGroup('A'), equals(5));
274+
expect(tq.numWaitingWithGroup('A'), equals(4));
275275

276276
await tq.resumeAll(group: 'A');
277277
await Future.delayed(const Duration(seconds: 1));

0 commit comments

Comments
 (0)