Skip to content

Commit

Permalink
Fix flaky tests (Shopify#1186)
Browse files Browse the repository at this point in the history
  • Loading branch information
uchoudh-zz authored and shopmike committed Oct 11, 2019
1 parent 2bfeed2 commit 1223444
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/integration/render_profiling_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,18 @@ def test_profiling_marks_children_of_for_blocks
assert_equal(2, t.profiler[0].children.length)
end

def test_total_time_equals_self_time_in_leaf
def test_profiling_supports_self_time
t = Template.parse("{% for item in collection %} {{ item }} {% endfor %}", profile: true)
t.render!("collection" => ["one", "two"])
leaf = t.profiler[0].children[0]

assert_equal leaf.total_time, leaf.self_time
assert_operator leaf.self_time, :>, 0
end

def test_total_time_greater_than_self_time_in_node
def test_profiling_supports_total_time
t = Template.parse("{% if true %} {% increment test %} {{ test }} {% endif %}", profile: true)
t.render!

assert_operator t.profiler[0].total_time, :>, t.profiler[0].self_time
assert_operator t.profiler[0].total_time, :>, 0
end
end

0 comments on commit 1223444

Please sign in to comment.