summaryrefslogtreecommitdiff
path: root/tests/modules/process/test.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-02-04 23:10:47 +0800
committerruki <[email protected]>2020-02-07 22:45:56 +0800
commit7cf854042808382beff5e3ceaaa430f8369d980c (patch)
tree867e20659d3ffcf9e1a9d484a12cd2a9d65eb3b0 /tests/modules/process/test.lua
parent9d205f5db11e184073990883e1a7b94d1d4b783b (diff)
improve co_group_begin
Diffstat (limited to 'tests/modules/process/test.lua')
-rw-r--r--tests/modules/process/test.lua11
1 files changed, 6 insertions, 5 deletions
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