Skip to content

Commit 41ed26b

Browse files
tests: avoid assertion failure on socket receive EOF in 058-tcp-socket.
Replace assert(sock:receive()) with a nil-check that breaks the loop, so a clean EOF doesn't abort the test handler.
1 parent 02ec8a5 commit 41ed26b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

t/058-tcp-socket.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4517,7 +4517,8 @@ reused times: 3, setkeepalive err: closed
45174517
local sock = assert(ngx.req.socket(true))
45184518
local data
45194519
while true do
4520-
data = assert(sock:receive())
4520+
data = sock:receive()
4521+
if not data then break end
45214522
assert(data == "hello")
45224523
end
45234524
}

0 commit comments

Comments
 (0)