Skip to content

Intermittent system test error on .alert-success #10140

@jywarren

Description

@jywarren

We've had intermittent system test errors before, and it sometimes boils down to timing errors or order of execution errors. See #9662 #9247

We're now seeing this one:

ERROR PostTest#test_awarding_barnstar_functions_correctly (196.06s)
Minitest::UnexpectedError:         Capybara::ExpectationNotMet: expected to find css "div.alert-success" but there were no matches
            test/system/post_test.rb:253:in `block in <class:PostTest>'

It's on line 253 of post_test.rb:

test "awarding barnstar functions correctly" do
note = nodes(:one)
visit note.path
find("span[data-original-title='Tools']").click()
find("input[value='Give']").click()
# Wait for the alert to be shown
wait_for_ajax
page.assert_selector("div.alert-success", text: "You awarded the basic barnstar to #{note.author.name}")
page.assert_selector("p", text: "#{note.author.name} was awarded the Basic Barnstar by palpatine for their work in this research note.")
page.assert_selector(".comment-body p", text: "@palpatine awards a barnstar to #{note.author.name} for their awesome contribution!")
end

Is this a standard way to wait? Why are we using page.assert_selector instead of just assert_selector?

Also, i think possibly this alert disappears after a few seconds. Could it be disappearing before we check for it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugthe issue is regarding one of our programs which faces problems when a certain task is executed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions