openresty / openresty/lua-resty-core

Random test failures in t/re-sub.t

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

Nobody has claimed this yet.

Dominant language
Lua
Stars
853
Forks
286
Avg merge
35m
Merged PRs (30d)
1

Description

I'm seeing the following random test failures on Fedora x86_64:

$ TEST_NGINX_INIT_BY_LUA="jit.opt.start('minstitch=0') require('resty.core.base').set_string_buf_size(1) require('resty.core.regex').set_buf_grow_ratio(1)" \
    TEST_NGINX_SLEEP=0.005 \
	prove -r -I../test-nginx/lib t/re-sub.t

t/re-sub.t .. 1/106 
#   Failed test 'TEST 4: replace template + submatches - pattern "NYI" should not match any line in error.log but matches line "[TRACE --- (1/0) base.lua:184 -- NYI: return to lower frame at ffi.new]" (req 0
# [TRACE --- (1/0) base.lua:184 -- NYI: return to lower frame at ffi.new]
# [TRACE --- (1/0) base.lua:184 -- NYI: return to lower frame at ffi.new]
# [TRACE --- (1/0) base.lua:184 -- NYI: return to lower frame at ffi.new]
# [TRACE   3 (1/0) base.lua:184 -- fallback to interpreter]
# [TRACE --- regex.lua:1189 -- inner loop in root trace at regex.lua:1082]
# [TRACE --- (2/0) regex.lua:829 -- loop unroll limit reached at regex.lua:1199]
# [TRACE   4 regex.lua:348 return]
# [TRACE   5 regex.lua:814 return]
# [TRACE --- (2/0) regex.lua:829 -- loop unroll limit reached at regex.lua:1199]
# '
#   at /home/dev/work/org/lua-resty-core/../test-nginx/lib/Test/Nginx/Socket.pm line 1280.

t/re-sub.t .. 35/106 
#   Failed test 'TEST 1: sub, no submatch, no jit compile, regex cache - pattern "NYI" should not match any line in error.log but matches line "[TRACE --- (1/0) base.lua:184 -- NYI: return to lower frame at 
ffi.new]" (req 0)
# [TRACE --- (1/0) base.lua:184 -- NYI: return to lower frame at ffi.new]
# [TRACE --- (1/0) base.lua:184 -- NYI: return to lower frame at ffi.new]
# [TRACE --- (1/0) base.lua:184 -- NYI: return to lower frame at ffi.new]
# [TRACE --- regex.lua:1060 -- inner loop in root trace at regex.lua:1082]
# [TRACE   3 (1/0) base.lua:184 -- fallback to interpreter]
# [TRACE --- (2/0) regex.lua:829 -- loop unroll limit reached at regex.lua:1204]
# [TRACE --- regex.lua:1189 -- inner loop in root trace at regex.lua:1082]
# [TRACE --- (2/0) regex.lua:829 -- loop unroll limit reached at regex.lua:1204]
# [TRACE --- (2/0) regex.lua:829 -- loop unroll limit reached at regex.lua:1204]
# '
#   at /home/dev/work/org/lua-resty-core/../test-nginx/lib/Test/Nginx/Socket.pm line 1280.

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/re-sub.t and reproduce using the TEST_NGINX_INIT_BY_LUA and TEST_NGINX_SLEEP command shown in the report. Inspect the failure location at test-nginx/lib/Test/Nginx/Socket.pm:1280 and the emitted LuaJIT trace lines; done means the random failures no longer occur under this reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.