Skip to content

Commit 9b0896d

Browse files
Lord-KATotktonada
authored andcommitted
test: make treegen.clean more durable
Usually treegen.clean is called after a test by g.after_all function or an equivalent. In some rare cases internal helpers use their own treegen and clean up after themself. In such a case, treegen.clean would look for an internal list of all directories and find nil. This causes an error in ipairs iteration in internal logic and fails the whole test. This patch adds minor durability improvement for such a case. Now if internal list of all directories is nil (e.g. when treegen.clean was called beforehand), the function does nothing. Part of tarantool#8967 NO_DOC=test helper update NO_CHANGELOG=see NO_DOC NO_TEST=see NO_DOC
1 parent 1af2b13 commit 9b0896d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/treegen.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ end
7979
-- unless KEEP_DATA environment variable is set to a
8080
-- non-empty value.
8181
function treegen.clean(g)
82-
local dirs = table.copy(g.tempdirs)
82+
local dirs = table.copy(g.tempdirs) or {}
8383
g.tempdirs = nil
8484

8585
local keep_data = (os.getenv('KEEP_DATA') or '') ~= ''

0 commit comments

Comments
 (0)