Skip to content

Commit

Permalink
fix 01/02
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw authored and locao committed Jun 10, 2022
1 parent 72e3527 commit 7427b62
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
18 changes: 10 additions & 8 deletions t/with_resty-events/01-start-stop.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ our $HttpConfig = qq{
lua_package_path "$pwd/lib/?.lua;;";
lua_shared_dict test_shm 8m;

init_worker_by_lua_block {
local we = require "resty.events.compat"
assert(we.configure({
unique_timeout = 5,
broker_id = 0,
listening = "unix:$ENV{TEST_NGINX_SERVROOT}/worker_events.sock"
}))
assert(we.configured())
}

server {
server_name kong_worker_events;
listen unix:$ENV{TEST_NGINX_SERVROOT}/worker_events.sock;
Expand All @@ -33,8 +43,6 @@ __DATA__
--- config
location = /t {
content_by_lua_block {
local we = require "resty.events.compat"
assert(we.configure({ unique_timeout = 5, broker_id = 0, listening = "unix:" .. ngx.config.prefix() .. "worker_events.sock" }))
local healthcheck = require("resty.healthcheck")
local checker = healthcheck.new({
name = "testing",
Expand Down Expand Up @@ -70,8 +78,6 @@ true
--- config
location = /t {
content_by_lua_block {
local we = require "resty.events.compat"
assert(we.configure({ unique_timeout = 5, broker_id = 0, listening = "unix:" .. ngx.config.prefix() .. "worker_events.sock" }))
local healthcheck = require("resty.healthcheck")
local checker = healthcheck.new({
name = "testing",
Expand Down Expand Up @@ -110,8 +116,6 @@ true
--- config
location = /t {
content_by_lua_block {
local we = require "resty.events.compat"
assert(we.configure({ unique_timeout = 5, broker_id = 0, listening = "unix:" .. ngx.config.prefix() .. "worker_events.sock" }))
local healthcheck = require("resty.healthcheck")
local checker = healthcheck.new({
name = "testing",
Expand Down Expand Up @@ -145,8 +149,6 @@ checking
--- config
location = /t {
content_by_lua_block {
local we = require "resty.events.compat"
assert(we.configure({ unique_timeout = 5, broker_id = 0, listening = "unix:" .. ngx.config.prefix() .. "worker_events.sock" }))
local healthcheck = require("resty.healthcheck")
local checker = healthcheck.new({
name = "testing",
Expand Down
22 changes: 13 additions & 9 deletions t/with_resty-events/02-add_target.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ our $HttpConfig = qq{
lua_package_path "$pwd/lib/?.lua;;";
lua_shared_dict test_shm 8m;

init_worker_by_lua_block {
local we = require "resty.events.compat"
assert(we.configure({
unique_timeout = 5,
broker_id = 0,
listening = "unix:$ENV{TEST_NGINX_SERVROOT}/worker_events.sock"
}))
assert(we.configured())
}

server {
server_name kong_worker_events;
listen unix:$ENV{TEST_NGINX_SERVROOT}/worker_events.sock;
Expand All @@ -33,13 +43,11 @@ __DATA__
--- config
location = /t {
content_by_lua_block {
local we = require "resty.events.compat"
assert(we.configure({ unique_timeout = 5, broker_id = 0, listening = "unix:" .. ngx.config.prefix() .. "worker_events.sock" }))
local healthcheck = require("resty.healthcheck")
local checker = healthcheck.new({
name = "testing",
shm_name = "test_shm",
events_module = "resty.events",
events_module = "resty.events",
checks = {
active = {
healthy = {
Expand Down Expand Up @@ -85,13 +93,11 @@ qq{
--- config
location = /t {
content_by_lua_block {
local we = require "resty.events.compat"
assert(we.configure({ unique_timeout = 5, broker_id = 0, listening = "unix:" .. ngx.config.prefix() .. "worker_events.sock" }))
local healthcheck = require("resty.healthcheck")
local checker = healthcheck.new({
name = "testing",
shm_name = "test_shm",
events_module = "resty.events",
events_module = "resty.events",
checks = {
active = {
http_path = "/status",
Expand Down Expand Up @@ -138,13 +144,11 @@ qq{
--- config
location = /t {
content_by_lua_block {
local we = require "resty.events.compat"
assert(we.configure({ unique_timeout = 5, broker_id = 0, listening = "unix:" .. ngx.config.prefix() .. "worker_events.sock" }))
local healthcheck = require("resty.healthcheck")
local checker = healthcheck.new({
name = "testing",
shm_name = "test_shm",
events_module = "resty.events",
events_module = "resty.events",
checks = {
active = {
http_path = "/status",
Expand Down
2 changes: 1 addition & 1 deletion t/with_resty-events/10-garbagecollect.t
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ qq{
local checker = healthcheck.new({
name = "testing",
shm_name = "test_shm",
events_module = "resty.events",
events_module = "resty.events",
type = "http",
checks = {
active = {
Expand Down

0 comments on commit 7427b62

Please sign in to comment.