From 7cf854042808382beff5e3ceaaa430f8369d980c Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 4 Feb 2020 23:10:47 +0800 Subject: improve co_group_begin --- tests/modules/process/test.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/modules/process/test.lua') diff --git a/tests/modules/process/test.lua b/tests/modules/process/test.lua index 30a42fd99..3835272b4 100644 --- a/tests/modules/process/test.lua +++ b/tests/modules/process/test.lua @@ -25,10 +25,11 @@ function test_sched_process(t) stderr:close() count = count + 1 end - local cotasks = {} - for i = 1, 3 do - table.insert(cotasks, scheduler.co_start(_session)) - end - scheduler.co_waitexit(cotasks) + scheduler.co_group_begin("test", function () + for i = 1, 3 do + scheduler.co_start(_session) + end + end) + scheduler.co_group_wait("test") t:are_equal(count, 3) end -- cgit v1.3.1