[Tarantool-patches] [PATCH luajit] test: adapt test checking reversed function

Maxim Kokryashkin max.kokryashkin at gmail.com
Thu Sep 30 14:43:37 MSK 2021


The first fiber in Tarantool has only 512Kb of the stack which is not enough to
handle such a deep call chain.
The test is adapted to Tarantool by decreasing the string length.

Closes tarantool/tarantool#5782
Part of tarantool/tarantool#5845
Part of tarantool/tarantool#4473
---
GitHub branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-5782-adapt-deep-nest-gsub-PUC-Rio
Issue: https://github.com/tarantool/tarantool/issues/5782

 test/PUC-Rio-Lua-5.1-tests/pm.lua | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/test/PUC-Rio-Lua-5.1-tests/pm.lua b/test/PUC-Rio-Lua-5.1-tests/pm.lua
index e364ff9d..7da3ef4a 100644
--- a/test/PUC-Rio-Lua-5.1-tests/pm.lua
+++ b/test/PUC-Rio-Lua-5.1-tests/pm.lua
@@ -206,12 +206,11 @@ function rev (s)
   return string.gsub(s, "(.)(.+)", function (c,s1) return rev(s1)..c end)
 end
 
-local x = string.rep('012345', 10)
--- FIXME: The first Tarantool's fiber has only 512Kb of stack.
--- It is not enough for this recursive call.
+-- This test is adapted to match the stack size (512Kb) of the first fiber in
+-- Tarantool.
 -- See also https://github.com/tarantool/tarantool/issues/5782.
--- The test is disabled for Tarantool binary.
--- assert(rev(rev(x)) == x)
+local x = string.rep('01234', 10)
+assert(rev(rev(x)) == x)
 
 
 -- gsub with tables
-- 
2.33.0



More information about the Tarantool-patches mailing list