Skip to content

Commit 842d8f4

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 8fee0a3 commit 842d8f4

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
@@ -119,6 +119,10 @@ local function create_new_space(g)
119119
end)
120120
end
121121

122+
local function truncate_space_on_cluster(g)
123+
helpers.truncate_space_on_cluster(g.cluster, space_name)
124+
end
125+
122126
-- If there weren't any operations, space stats is {}.
123127
-- To compute stats diff, this helper return real stats
124128
-- if they're already present or default stats if
@@ -446,6 +450,8 @@ local function generate_stats(g)
446450
else
447451
t.assert_not_equals(err, nil)
448452
end
453+
454+
helpers.truncate_space_on_cluster(g.cluster, space_name)
449455
end
450456

451457
-- Generate non-null select details.
@@ -559,6 +565,8 @@ for name, case in pairs(simple_operation_cases) do
559565

560566
t.assert_equals(unchanged_before, unchanged_after, 'Other stats remained the same')
561567
end
568+
569+
pgroup.after_test(test_name, truncate_space_on_cluster)
562570
end
563571

564572

0 commit comments

Comments
 (0)