Skip to content

Commit 2cca983

Browse files
committed
test(162-exit-worker.t): improve the test cases
1 parent d35cfc5 commit 2cca983

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

t/162-exit-worker.t

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use Test::Nginx::Socket::Lua;
55
master_on();
66
repeat_each(2);
77

8-
plan tests => repeat_each() * (blocks() * 2 + 7);
8+
plan tests => repeat_each() * (blocks() * 2 + 8);
99

1010
#log_level("warn");
1111
no_long_string();
@@ -146,7 +146,8 @@ get val: 100
146146
}
147147

148148
exit_worker_by_lua_block {
149-
ngx.log(ngx.NOTICE, "hello from exit worker by lua")
149+
local process = require "ngx.process"
150+
ngx.log(ngx.INFO, "hello from exit worker by lua, process type: ", process.type())
150151
}
151152
--- config
152153
location = /t {
@@ -160,8 +161,8 @@ get val: 100
160161
[
161162
qr/cache loader process \d+ exited/,
162163
qr/cache manager process \d+ exited/,
163-
qr/hello from exit worker by lua$/,
164-
qr/hello from exit worker by lua$/,
164+
qr/hello from exit worker by lua, process type: worker/,
165+
qr/hello from exit worker by lua, process type: privileged agent/,
165166
qr/privileged agent process \d+ exited/,
166167
]
167168

@@ -174,7 +175,8 @@ qr/privileged agent process \d+ exited/,
174175
proxy_cache_path /tmp/cache levels=1:2 keys_zone=cache:1m;
175176

176177
exit_worker_by_lua_block {
177-
ngx.log(ngx.WARN, "hello from exit worker by lua")
178+
local process = require "ngx.process"
179+
ngx.log(ngx.INFO, "hello from exit worker by lua, process type: ", process.type())
178180
}
179181
--- config
180182
location = /t {
@@ -187,5 +189,7 @@ qr/privileged agent process \d+ exited/,
187189
start privileged agent process
188190
--- shutdown_error_log eval
189191
[
190-
qr/hello from exit worker by lua$/,
192+
qr/cache loader process \d+ exited/,
193+
qr/cache manager process \d+ exited/,
194+
qr/hello from exit worker by lua, process type: worker/,
191195
]

0 commit comments

Comments
 (0)