Skip to content

Commit a3e39e1

Browse files
committed
Add truncate space on cluster in tests for stats
Before this commit `simple_operation_cases` were organized as map (table indexed not with numbers), in Lua iteration over map does not occur in the order in which the elements were specified in the map. But simple operation tests could fail in case if tests would be executed not in the order in which they are specified, because, for example, if `replace()` is performed before `insert()`, an error will be received. So simple operation tests are codependent. To solve this problem `truncate_space_on_cluster` was added after each simple operation test. Part of #193
1 parent 379a252 commit a3e39e1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/integration/stats_test.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ local function create_new_space(g)
116116
end)
117117
end
118118

119+
local function truncate_space_on_cluster(g)
120+
helpers.truncate_space_on_cluster(g.cluster, space_name)
121+
end
122+
119123
-- If there weren't any operations, space stats is {}.
120124
-- To compute stats diff, this helper return real stats
121125
-- if they're already present or default stats if
@@ -442,6 +446,8 @@ local function generate_stats(g)
442446
else
443447
t.assert_not_equals(err, nil)
444448
end
449+
450+
helpers.truncate_space_on_cluster(g.cluster, space_name)
445451
end
446452

447453
-- Generate non-null select details.
@@ -537,6 +543,8 @@ for name, case in pairs(simple_operation_cases) do
537543

538544
t.assert_equals(unchanged_before, unchanged_after, 'Other stats remained the same')
539545
end
546+
547+
pgroup.after_test(test_name, truncate_space_on_cluster)
540548
end
541549

542550

0 commit comments

Comments
 (0)