openresty / openresty/test-nginx

"Non-zero exit status: 3", what is this mean?

Open
#111 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
456
Forks
112
PR merge metrics
No merged PRs in 30d

Description

`use Test::Nginx::Socket::Lua::Stream;

log_level('warn');
no_long_string();
run_tests();
DATA

=== TEST 1: simple test for ngx_stream_echo_module
--- stream_server_config
content_by_lua_block {
ngx.say("Hello, stream echo!")
}

--- stream_response
Hello, stream echo!

--- no_error_log
[error]`
The above is my test code.The result is:
t/test.t .. nginx main pid[18259] ppid[18258] log_ratelimit[0],log_ratelimit_burst[0],file[src/core/nginx.c],line[547],func[main]
first init pid[18259] ppid[18258] log_ratelimit[0],log_ratelimit_burst[0],p_interval[0,0x7ff019f3f080],p_burst[0,0x7ff019f3f100],file[src/core/nginx.c],line[310],func[ngx_init_log_ratelimit_state_ctl]

ok 1 - TEST 1: simple test for ngx_stream_echo_module - status code ok
ok 2 - TEST 1: simple test for ngx_stream_echo_module - response_body - response is expected (repeated req 0, req 0)
ok 3 - TEST 1: simple test for ngx_stream_echo_module - pattern "[error]" does not match a line in error.log (req 0)
Can't determine section names. Need two sections in first block at t/test.t line 0.
END failed--call queue aborted.
1..3

Looks like your test exited with 3 just after 3.

Dubious, test returned 3 (wstat 768, 0x300)
All 3 subtests passed

Test Summary Report

t/test.t (Wstat: 768 Tests: 3 Failed: 0)
Non-zero exit status: 3
Files=1, Tests=3, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.24 cusr 0.03 csys = 0.31 CPU)
Result: FAIL

Which I can't understand that why the result is failed while all tests are passed.
Where can i find the meaning of "Non-zero exit status: 3"?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with t/test.t and the Test::Nginx::Socket::Lua::Stream run_tests entry point, then reproduce the shown output to trace the section-parsing and exit-status handling. Determine why the harness reports exit status 3 after the three tests pass, and document whether the behavior is expected or should be corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
nginx, perl
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.